<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSGestureRecognizer/State-swift.enum",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@E@NSGestureRecognizerState"
  },
  "title" : "NSGestureRecognizer.State"
}
-->

# NSGestureRecognizer.State

The current state of the gesture recognizer.

```
enum State
```

## Topics

### Getting state values

[`NSGestureRecognizer.State.possible`](/documentation/AppKit/NSGestureRecognizer/State-swift.enum/possible)

The gesture recognizer has not yet recognized its gesture but may be evaluating events. This is the default state.

[`NSGestureRecognizer.State.began`](/documentation/AppKit/NSGestureRecognizer/State-swift.enum/began)

The gesture recognizer has recognized a sequence of events as a continuous gesture. It calls its action method at the next cycle of the run loop.

[`NSGestureRecognizer.State.changed`](/documentation/AppKit/NSGestureRecognizer/State-swift.enum/changed)

The gesture recognizer has detected a change to a continuous gesture. It calls its action method at the next cycle of the run loop.

[`NSGestureRecognizer.State.ended`](/documentation/AppKit/NSGestureRecognizer/State-swift.enum/ended)

The gesture recognizer has detected the end of a continuous gesture. It calls its action method at the next cycle of the run loop and resets its state to [`NSGestureRecognizer.State.possible`](/documentation/AppKit/NSGestureRecognizer/State-swift.enum/possible).

[`NSGestureRecognizer.State.cancelled`](/documentation/AppKit/NSGestureRecognizer/State-swift.enum/cancelled)

The gesture recognizer received events that resulted in the cancellation of a continuous gesture. It calls its action method at the next cycle of the run loop and resets its state to [`NSGestureRecognizer.State.possible`](/documentation/AppKit/NSGestureRecognizer/State-swift.enum/possible).

[`NSGestureRecognizer.State.failed`](/documentation/AppKit/NSGestureRecognizer/State-swift.enum/failed)

The gesture recognizer failed to recognize its gesture and will not call its action method. The gesture recognizer resets itself to the [`NSGestureRecognizer.State.possible`](/documentation/AppKit/NSGestureRecognizer/State-swift.enum/possible) state.

[`recognized`](/documentation/AppKit/NSGestureRecognizer/State-swift.enum/recognized)

The gesture recognizer successfully recognized its gesture. It calls its action method at the next cycle of the run loop and resets its state to [`NSGestureRecognizer.State.possible`](/documentation/AppKit/NSGestureRecognizer/State-swift.enum/possible).

### Creating a state

[`init(rawValue:)`](/documentation/AppKit/NSGestureRecognizer/State-swift.enum/init(rawValue:))



---

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)