Handler State
Gesture handlers can be treated as "state machines". At any given time, each handler instance has an assigned state that can change when new touch events occur or can be forced to change by the touch system in certain circumstances.
States manage the internal recognition process. You can hook into these transitions using specific gesture callbacks.
| State | Description | Callback |
|---|---|---|
UNDETERMINED | The default initial state of every handler. | — |
BEGAN | The handler has started receiving touch data but hasn't yet met the activation criteria. | onBegin |
ACTIVE | The gesture is recognized and activation criteria are met. | onActivate when it first transitions into the ACTIVE state. onUpdate when it has new data about the gesture. |
END | The user successfully completed the gesture. | onDeactivate with didSucceed parameter set to true. onFinalize with didSucceed parameter set to true. |
FAILED | The handler failed to recognize the gesture. | onDeactivate if the gesture was in ACTIVE state before. didSucceed parameter will be set to false onFinalize with didSucceed parameter set to false. |
CANCELLED | The system interrupted the gesture. | onDeactivate if the gesture was in ACTIVE state before. didSucceed parameter will be set to false onFinalize with didSucceed parameter set to false. |