---
title: "gestureRecognizer(_:shouldReceive:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsgesturerecognizerdelegate/gesturerecognizer(_:shouldreceive:)"
---

# gestureRecognizer(_:shouldReceive:)

Called, for a new touch, before the system calls the touchesBegan:withEvent: method on the gesture recognizer. Return NO to prevent the gesture recognizer from seeing this touch.

## Declaration

```swift
@MainActor optional func gestureRecognizer(_ gestureRecognizer: NSGestureRecognizer, shouldReceive touch: NSTouch) -> Bool
```
