Initializer

init(states:)

Initializes a state machine with the specified states.

Declaration

init(states: [GKState])

Parameters

states

An array of state objects. Each object in the array must be of a unique subclass of GKState.

Return Value

A new state machine.

Discussion

The newly created state machine’s currentState property is nil. To choose and enter an initial state, use the enter(_:) method.

See Also