---
title: "init(title:action:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uimenuitem/init(title:action:)"
---

# init(title:action:)

Creates and returns a menu-item object initialized with the given title and action.

## Declaration

```swift
init(title: String, action: Selector)
```

## Parameters

- `title`: The title of the menu item.
- `action`: A selector identifying the method of the responder object to invoke for handling the command represented by the menu item.

## Return Value

Return Value An initialized UIMenuItem object, or nil if there was a problem creating the object.
