<!--
{
  "availability" : [
    "iOS: 3.2.0 - 16.0.0",
    "iPadOS: 3.2.0 - 16.0.0",
    "macCatalyst: 13.1.0 - 16.0.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIMenuItem/init(title:action:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIMenuItem(im)initWithTitle:action:"
  },
  "title" : "init(title:action:)"
}
-->

# init(title:action:)

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

```
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

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)