<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: -",
    "tvOS: 14.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIAction/init(title:image:identifier:discoverabilityTitle:attributes:state:handler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "s:So8UIActionC5UIKitE5title5image10identifier20discoverabilityTitle10attributes5state7handlerABSS_So7UIImageCSgSo0A10IdentifieraSgSSSgSo23UIMenuElementAttributesVSo0mN5StateVyABctcfc"
  },
  "title" : "init(title:image:identifier:discoverabilityTitle:attributes:state:handler:)"
}
-->

# init(title:image:identifier:discoverabilityTitle:attributes:state:handler:)

Creates an action with the specified title, image, identifier, discoverability title, attributes, state, and handler.

```
@MainActor @preconcurrency convenience init(title: String = "", image: UIImage? = nil, identifier: UIAction.Identifier? = nil, discoverabilityTitle: String? = nil, attributes: UIMenuElement.Attributes = [], state: UIMenuElement.State = .off, handler: @escaping UIActionHandler)
```

## Parameters

`title`

The title to display for the action.

`image`

The image to display next to the action’s `title`. Only the [`context`](/documentation/UIKit/UIMenuSystem/context) menu system supports the display of an image, and only when the app is running in iOS.

`identifier`

The unique identifier for the action. Specify `nil` to let this method create a unique identifier for you.

`discoverabilityTitle`

An elaborated title that explains the purpose of the action.

`attributes`

The attributes indicating the style of the action.

`state`

The initial state of the action.

`handler`

The handler to invoke after a person selects the action. This handler has the following parameter:

- action: The action that a person selects.

## Discussion

---

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)