<!--
{
  "availability" : [
    "macOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/NSGestureRecognizerRepresentable/handleNSGestureRecognizerAction(_:context:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI32NSGestureRecognizerRepresentableP06handlecD6Action_7contexty0cD4TypeQz_AA0cdE7ContextVyxGtF"
  },
  "title" : "handleNSGestureRecognizerAction(_:context:)"
}
-->

# handleNSGestureRecognizerAction(_:context:)

Handles recognition of the represented `NSGestureRecognizer`.

```
@MainActor @preconcurrency func handleNSGestureRecognizerAction(_ recognizer: Self.NSGestureRecognizerType, context: Self.Context)
```

## Parameters

`recognizer`

An instance of the represented gesture
recognizer.

`context`

A context structure containing information about
the current state of the system, such as the current coordinator
instance.

## Discussion

If you implement this method, SwiftUI calls it when the wrapped
gesture recognizer is recognized.

---

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)