---
title: view
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsgesturerecognizer/view
---

# view

The view to which the gesture recognizer is attached.

## Declaration

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

## Discussion

Discussion To attach a gesture recognizer to a view, call the addGestureRecognizer(_:) method of the view. If the gesture recognizer is not attached to a view, the value in this property is nil.

## See Also

### Related Documentation

- [location(in:)](appkit/nsgesturerecognizer/location(in:).md)

### Accessing the Recognizer’s State

- [state](appkit/nsgesturerecognizer/state-swift.property.md)
- [isEnabled](appkit/nsgesturerecognizer/isenabled.md)
