State
Defines a State.
-
The state name
Declaration
Swift
public var name: String -
The notification to dispatch when entering the state
Declaration
Swift
public var entering: String? -
The notification to dispatch when exiting the state
Declaration
Swift
public var exiting: String? -
The notification to dispatch when the state has actually changed
Declaration
Swift
public var changed: String? -
Constructor.
Declaration
Swift
public init(name: String, entering: String?=nil, exiting: String?=nil, changed: String?=nil)Parameters
idthe id of the state
enteringan optional notification name to be sent when entering this state
exitingan optional notification name to be sent when exiting this state
changedan optional notification name to be sent when fully transitioned to this state
-
Define a transition.
Declaration
Swift
public func defineTrans(action: String, target: String)Parameters
actionthe name of the StateMachine.ACTION Notification type.
targetthe name of the target state to transition to.
-
Remove a previously defined transition.
Declaration
Swift
public func removeTrans(action: String) -> String?Return Value
the name of the target associated with the action
-
Get the target state name for a given action.
Declaration
Swift
public func getTarget(action: String) -> String?
View on GitHub
State Class Reference