<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UICommandAlternate/init(title:action:modifierFlags:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UICommandAlternate(cm)alternateWithTitle:action:modifierFlags:"
  },
  "title" : "init(title:action:modifierFlags:)"
}
-->

# init(title:action:modifierFlags:)

Creates a command alternative with the specified title, action, and modifier flags.

```
convenience init(title: String, action: Selector, modifierFlags: UIKeyModifierFlags)
```

## Parameters

`title`

The command alternative’s title.

`action`

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

`modifierFlags`

The bit mask of modifier keys that a person must press. You can use this parameter to specify which modifier keys (Command, Option, and so on) a person must also press. You may specify more than one modifier key. For a list of possible values, see [`UIKeyModifierFlags`](/documentation/UIKit/UIKeyModifierFlags).

## Return Value

A command alternative 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)