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

# init(title:image:action:propertyList:alternates:discoverabilityTitle:attributes:state:)

Creates a command with the specified title, image, action, property list, alternative commands, discoverability title, attributes, and state.

```
@MainActor @preconcurrency convenience init(title: String = "", image: UIImage? = nil, action: Selector, propertyList: Any? = nil, alternates: [UICommandAlternate] = [], discoverabilityTitle: String? = nil, attributes: UIMenuElement.Attributes = [], state: UIMenuElement.State = .off)
```

## Parameters

`title`

The title to display for the command.

`image`

The image to display next to the command’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.

`action`

The action to take after a person user selects the command.

`propertyList`

An object that contains data to associate with the command.

`alternates`

An array of alternatives for the command.

`discoverabilityTitle`

An elaborated title that explains the purpose of the command.

`attributes`

The attributes indicating the style of the command.

`state`

The initial state of the command.

---

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)