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
id
the id of the state
entering
an optional notification name to be sent when entering this state
exiting
an optional notification name to be sent when exiting this state
changed
an 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
action
the name of the StateMachine.ACTION Notification type.
target
the 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?