Link Search Menu Expand Document

Command

A menu element that performs its action in a selector.

public class Command: MenuElement 

Inheritance

MenuElement

Initializers

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

Creates a command.

public /*convenience*/ init(title: String = "", image: Image? = nil,
                              action: @escaping (_: AnyObject?) -> Void,
                              propertyList: Any? = nil,
                              alternates: [CommandAlternate] = [],
                              discoverabilityTitle: String? = nil,
                              attributes: MenuElement.Attributes = [],
                              state: MenuElement.State = .off) 

Properties

title

The command’s title.

public override var title: String 

image

The command’s image.

public override var image: Image? 

action

The selector identifying the action method called after the user selects the command.

public var action: (_: AnyObject?) -> Void

discoverabilityTitle

An elaborated title that explains the purpose of the command.

public var discoverabilityTitle: String?

attributes

The attributes indicating the style of the command.

public var attributes: MenuElement.Attributes

state

The state of the command.

public var state: MenuElement.State

alternates

An array of alternative actions to take for the command.

public private(set) var alternates: [CommandAlternate]