You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gesture handlers can be treated as ["state machines"](https://en.wikipedia.org/wiki/Finite-state_machine).
8
10
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.
9
11
10
12
States manage the internal recognition process. You can hook into these transitions using specific gesture callbacks.
|**`UNDETERMINED`**| The default initial state of every handler. | — |
15
-
|**`BEGAN`**| The handler has started receiving touch data but hasn't yet met the activation criteria. |[`onBegin`](/docs/fundamentals/callbacks-events#onbegin)|
16
-
|**`ACTIVE`**| The gesture is recognized and activation criteria are met. |[`onActivate`](/docs/fundamentals/callbacks-events#onactivate) when it first transitions into the `ACTIVE` state. <br /><br /> [`onUpdate`](/docs/fundamentals/callbacks-events#onupdate) when it has new data about the gesture. |
17
-
|**`END`**| The user successfully completed the gesture. |[`onDeactivate`](/docs/fundamentals/callbacks-events#ondeactivate) with `event.canceled` set to `false`. <br/><br/> [`onFinalize`](/docs/fundamentals/callbacks-events#onfinalize) with `event.canceled` set to `false`. |
|**`UNDETERMINED`**| The default initial state of every handler. | — |
17
+
|**`BEGAN`**| The handler has started receiving touch data but hasn't yet met the activation criteria. |[`onBegin`](/docs/fundamentals/callbacks-events#onbegin)|
18
+
|**`ACTIVE`**| The gesture is recognized and activation criteria are met. |[`onActivate`](/docs/fundamentals/callbacks-events#onactivate) when it first transitions into the `ACTIVE` state. <br /><br /> [`onUpdate`](/docs/fundamentals/callbacks-events#onupdate) when it has new data about the gesture. |
19
+
|**`END`**| The user successfully completed the gesture. |[`onDeactivate`](/docs/fundamentals/callbacks-events#ondeactivate) with `event.canceled` set to `false`. <br/><br/> [`onFinalize`](/docs/fundamentals/callbacks-events#onfinalize) with `event.canceled` set to `false`. |
18
20
|**`FAILED`**| The handler failed to recognize the gesture. |[`onDeactivate`](/docs/fundamentals/callbacks-events#ondeactivate) if the gesture was in `ACTIVE` state before, with `event.canceled` set to `true`. <br/><br/> [`onFinalize`](/docs/fundamentals/callbacks-events#onfinalize) with `event.canceled` set to `true`. |
19
21
|**`CANCELLED`**| The system interrupted the gesture. |[`onDeactivate`](/docs/fundamentals/callbacks-events#ondeactivate) if the gesture was in `ACTIVE` state before, with `event.canceled` set to `true`. <br/><br/> [`onFinalize`](/docs/fundamentals/callbacks-events#onfinalize) with `event.canceled` set to `true`. |
22
+
23
+
## State flows
24
+
25
+
The most typical flow of state is when a gesture picks up on an initial touch event, then recognizes it, then acknowledges its ending and resets itself back to the initial state. Drag or hold the circle below to see how each state machine reacts.
0 commit comments