---
title: "makeNSGestureRecognizer(context:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/nsgesturerecognizerrepresentable/makensgesturerecognizer(context:)"
---

# makeNSGestureRecognizer(context:)

Creates an instance of the represented gesture recognizer.

## Declaration

```swift
@MainActor @preconcurrency func makeNSGestureRecognizer(context: Self.Context) -> Self.NSGestureRecognizerType
```

## Parameters

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

## Discussion

Discussion note: Gesture recognizers are created on-demand and torn down when an event sequence ends, so do not perform expensive work in this method.
