Class

UICommand

An object representing an action command.

Declaration

class UICommand : UIMenuElement

Topics

Creating a Command

Getting Information About the Command

var title: String

The command's title.

var discoverabilityTitle: String?

An elaborated title that explains the purpose of the command.

var image: UIImage?

The command's image.

var action: Selector

The command's action-method selector.

var state: UIMenuElement.State

The state of the command.

Getting Command Alternatives

var alternates: [UICommandAlternate]

An array of alternative actions to take for the command.

class UICommandAlternate

An object representing an alternative action for a command.

Associating Data

var propertyList: Any?

An object that contains data to associate with the command.

let UICommandTagShare: String

A value that identifies a command as a Sharing menu item.

Relationships

Inherits From

Conforms To

See Also

Menu Items and Keyboard Shortcuts

class UIKeyCommand

An object that specifies a key press performed on a hardware keyboard and the resulting action.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software