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

# documentView

The clip view’s document view.

```
var documentView: NSView? { get set }
```

## Discussion

If the clip view is contained in an [`NSScrollView`](/documentation/AppKit/NSScrollView), you should send the [`NSScrollView`](/documentation/AppKit/NSScrollView) a [`documentView`](/documentation/AppKit/NSScrollView/documentView) message instead, so it can perform whatever updating it needs. Setting this property to a view removes any previous document view, and sets the origin of the clip view’s bounds rectangle to the origin of the new view’s frame rectangle. Doing so also registers the clip view for the notifications [`frameDidChangeNotification`](/documentation/AppKit/NSView/frameDidChangeNotification) and [`boundsDidChangeNotification`](/documentation/AppKit/NSView/boundsDidChangeNotification), adjusts the key view loop to include the new document view, and updates a parent [`NSScrollView`](/documentation/AppKit/NSScrollView) display if needed using [`reflectScrolledClipView(_:)`](/documentation/AppKit/NSScrollView/reflectScrolledClipView(_:)).

## See Also

[`NSClipView`](/documentation/AppKit/NSClipView)

An object that clips a document view to a scroll view’s frame.



---

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)