---
title: "autoscroll(with:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsclipview/autoscroll(with:)"
---

# autoscroll(with:)

Scrolls the clip view proportionally to theEvent’s distance outside of it.

## Declaration

```swift
func autoscroll(with event: NSEvent) -> Bool
```

## Discussion

Discussion theEvent‘s location should be expressed in the window’s base coordinate system (which it normally is), not the receiving NSClipView. Returns true if any scrolling is performed; otherwise returns false. Never invoke this method directly; instead, the NSScrollView’s document view should repeatedly send itself autoscroll(with:) messages when the pointer is dragged outside the NSScrollView‘s frame during a modal event loop initiated by a mouse-down event. The NSView class implements autoscroll(with:) to forward the message to the receiver’s superview; thus the message is ultimately forwarded to the NSClipView.

## See Also

### Scrolling

- [scroll(to:)](appkit/nsclipview/scroll(to:).md)
- [constrainScroll(_:)](appkit/nsclipview/constrainscroll(_:).md)
- [constrainBoundsRect(_:)](appkit/nsclipview/constrainboundsrect(_:).md)
