One Logo Pool Ball
GameplayKit · IOS API REFERENCE

GKStateMachine

class · iOS 9.0+ · SDK 27.1

class GKStateMachine

Members (6)

method · iOS 9.0+

canEnterState

TypeScript
canEnterState(stateClass: string): boolean
Swift declaration
func canEnterState(_ stateClass: AnyClass) -> Bool
method · iOS 9.0+

enter

TypeScript
enter(stateClass: string): boolean
Swift declaration
func enter(_ stateClass: AnyClass) -> Bool
init · iOS 9.0+

init

TypeScript
static init(states: Array<GKState>): GKStateMachine
Swift declaration
init(states: [GKState])
method · iOS 9.0+

update

TypeScript
update(sec: number): void
Swift declaration
func update(deltaTime sec: TimeInterval)
get · iOS 9.0+

currentState

TypeScript
get currentState(): (GKState) | null
Swift declaration
var currentState: GKState? { get }
method · iOS 9.0+

state

TypeScript
state(stateClass: string): (GKState) | null
Swift declaration
func state<StateType>(forClass stateClass: StateType.Type) -> StateType? where StateType : GKState

Gets the state of the indicated class. Returns nil if the state machine does not have this state. - Parameter forClass: the type of the state you want to get

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

GKStateMachine.init()

inherited init: cannot prove legal (class declares 1 custom initializer)

All GameplayKit types →