<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSGestureRecognizer/view",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSGestureRecognizer(py)view"
  },
  "title" : "view"
}
-->

# view

The view to which the gesture recognizer is attached.

```
var view: NSView? { get }
```

## Discussion

To attach a gesture recognizer to a view, call the [`addGestureRecognizer(_:)`](/documentation/AppKit/NSView/addGestureRecognizer(_:)) method of the view. If the gesture recognizer is not attached to a view, the value in this property is `nil`.

## See Also

[`location(in:)`](/documentation/AppKit/NSGestureRecognizer/location(in:))

Returns the point computed as the location of the gesture.



---

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)