---
title: "handleNSGestureRecognizerAction(_:context:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/nsgesturerecognizerrepresentable/handlensgesturerecognizeraction(_:context:)"
---

# handleNSGestureRecognizerAction(_:context:)

Handles recognition of the represented NSGestureRecognizer.

## Declaration

```swift
@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

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