The abstract superclass for defining state-specific logic as part of a state machine.
- iOS 9.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
GKState abstract class defines the features of state classes to be used with a state machine (a
GKState object). You build a state machine by defining a separate
GKState subclass for each state of the machine. In each state class, you use the
is method to define which other states are valid for a machine to transition into. State classes provide a place to put state-dependent game logic, such as actions that should happen when entering or exiting a specific state, or per-frame update code that is valid only when in a specific state.