<!--
{
  "availability" : [
    "iOS: 3.2.0 -",
    "iPadOS: 3.2.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIGestureRecognizer/state-swift.property",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIGestureRecognizer(py)state"
  },
  "title" : "state"
}
-->

# state

The current state of the gesture recognizer.

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

## Discussion

The possible states a gesture recognizer can be in are represented by the constants of type [`UIGestureRecognizer.State`](/documentation/UIKit/UIGestureRecognizer/State-swift.enum). Some of these states aren’t applicable to discrete gestures. The read-only version of the [`state`](/documentation/UIKit/UIGestureRecognizer/state-swift.property) property is intended for clients of a gesture-recognizer class and not subclasses.

### Special considerations

Subclasses of [`UIGestureRecognizer`](/documentation/UIKit/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):

```objc
@property(nonatomic,readwrite) UIGestureRecognizerState state;
```

Recognizers for discrete gestures transition from [`UIGestureRecognizer.State.possible`](/documentation/UIKit/UIGestureRecognizer/State-swift.enum/possible) to [`UIGestureRecognizer.State.failed`](/documentation/UIKit/UIGestureRecognizer/State-swift.enum/failed) or [`recognized`](/documentation/UIKit/UIGestureRecognizer/State-swift.enum/recognized). Recognizers for continuous gesture transition from [`UIGestureRecognizer.State.possible`](/documentation/UIKit/UIGestureRecognizer/State-swift.enum/possible) to these phases in the given order: [`UIGestureRecognizer.State.began`](/documentation/UIKit/UIGestureRecognizer/State-swift.enum/began), [`UIGestureRecognizer.State.changed`](/documentation/UIKit/UIGestureRecognizer/State-swift.enum/changed), and [`UIGestureRecognizer.State.ended`](/documentation/UIKit/UIGestureRecognizer/State-swift.enum/ended). If, however, they receive a cancellation touch, they should transition to [`UIGestureRecognizer.State.cancelled`](/documentation/UIKit/UIGestureRecognizer/State-swift.enum/cancelled). If recognizers for continuous gestures can’t interpret a multi-touch sequence as their gesture, they transition to [`UIGestureRecognizer.State.failed`](/documentation/UIKit/UIGestureRecognizer/State-swift.enum/failed).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)