Creates a key command that you can use as a menu element with a shortcut key, or a shortcut key only for a view controller.
- iOS 13.0+
- Mac Catalyst 13.0+
- tvOS 13.0+
The title to display for the key command.
The image to display next to the key command's title. Only the
contextmenu system supports the display of an image, and only when the app runs in iOS.
The action to take after the user selects the key command.
The keys that the user must press. The string must contain one or more characters corresponding to the keys the user pressed. For a list of special characters that do not have a textual representation, see Input Strings for Special Keys.
The bit mask of modifier keys that the user must press. You can use this parameter to specify which modifier keys (Command, Option, and so on) the user must also press. You may specify more than one modifier key. For a list of possible values, see
An object that contains data to associate with the key command.
A newly initialized key command object.
After creating a key command object, you can: