---
title: state
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uigesturerecognizer/state-swift.property
---

# state

The current state of the gesture recognizer.

## Declaration

```swift
var state: UIGestureRecognizer.State { get set }
```

## Mentioned in

About the Gesture Recognizer State Machine Handling tap gestures

## Discussion

Discussion The possible states a gesture recognizer can be in are represented by the constants of type UIGestureRecognizer.State. Some of these states aren’t applicable to discrete gestures. The read-only version of the state property is intended for clients of a gesture-recognizer class and not subclasses. Special considerations Subclasses of UIGestureRecognizer must use a read-write version of the state property. They get this redeclaration when they import the UIGestureRecognizerSubclass.h header file (for Objective-C) or the UIKit.UIGestureRecognizerSubclass module (for Swift): @property(nonatomic,readwrite) UIGestureRecognizerState state; Recognizers for discrete gestures transition from UIGestureRecognizer.State.possible to UIGestureRecognizer.State.failed or recognized. Recognizers for continuous gesture transition from UIGestureRecognizer.State.possible to these phases in the given order: UIGestureRecognizer.State.began, UIGestureRecognizer.State.changed, and UIGestureRecognizer.State.ended. If, however, they receive a cancellation touch, they should transition to UIGestureRecognizer.State.cancelled. If recognizers for continuous gestures can’t interpret a multi-touch sequence as their gesture, they transition to UIGestureRecognizer.State.failed.

## See Also

### Getting the recognizer’s state and view

- [UIGestureRecognizer.State](uikit/uigesturerecognizer/state-swift.enum.md)
- [view](uikit/uigesturerecognizer/view.md)
- [isEnabled](uikit/uigesturerecognizer/isenabled.md)
- [buttonMask](uikit/uigesturerecognizer/buttonmask.md)
- [modifierFlags](uikit/uigesturerecognizer/modifierflags.md)
