---
title: enclosingScrollView
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsview/enclosingscrollview
---

# enclosingScrollView

The nearest ancestor scroll view that contains the current view.

## Declaration

```swift
var enclosingScrollView: NSScrollView? { get }
```

## Discussion

Discussion If the current view is not embedded inside a scroll view, the value of this property is nil. This property does not contain the current view if the current view is itself a scroll view. It always contains an ancestor scroll view.

## See Also

### Scrolling the View

- [prepareContent(in:)](appkit/nsview/preparecontent(in:).md)
- [preparedContentRect](appkit/nsview/preparedcontentrect.md)
- [scroll(_:)](appkit/nsview/scroll(_:).md)
- [scrollToVisible(_:)](appkit/nsview/scrolltovisible(_:).md)
- [autoscroll(with:)](appkit/nsview/autoscroll(with:).md)
- [adjustScroll(_:)](appkit/nsview/adjustscroll(_:).md)
- [scroll(_:to:)](appkit/nsview/scroll(_:to:).md)
- [reflectScrolledClipView(_:)](appkit/nsview/reflectscrolledclipview(_:).md)
- [isCompatibleWithResponsiveScrolling](appkit/nsview/iscompatiblewithresponsivescrolling.md)
