Link Search Menu Expand Document

Action

A menu element that performs its action in a closure.

open class Action: MenuElement 

Inheritance

MenuElement

Nested Type Aliases

ActionHandler

A type that defines the closure for an action handler.

public typealias ActionHandler = (Action) -> Void

Initializers

init(title:image:identifier:discoverabilityTitle:attributes:state:handler:)

Creates an action.

public /*convenience*/ init(title: String = "", image: Image? = nil,
                              identifier: Action.Identifier? = nil,
                              discoverabilityTitle: String? = nil,
                              attributes: MenuElement.Attributes = [],
                              state: MenuElement.State = .off,
                              handler: @escaping ActionHandler) 

Properties

title

The action’s title.

open override var title: String 

image

The action’s image.

open override var image: Image? 

identifier

The unique identifier for the action.

open private(set) var identifier: Action.Identifier

discoverabilityTitle

An elaborated title that explains the purpose of the action.

open var discoverabilityTitle: String?

attributes

The attributes indicating the style of the action.

open var attributes: MenuElement.Attributes

state

The state of the action.

open var state: MenuElement.State

sender

The object responsible for the action handler.

open internal(set) var sender: Any?