autoscroll(with:)
Scrolls the view’s closest ancestor Nsclipview object proportionally to the distance of an event that occurs outside of it.
Declaration
func autoscroll(with event: NSEvent) -> BoolParameters
- event:
An event object whose location should be expressed in the window’s base coordinate system (which it normally is), not the receiving view’s.
Return Value
Returns true if any scrolling is performed; otherwise returns false.
Discussion
View objects that track mouse-dragged events can use this method to scroll automatically when the cursor is dragged outside of the NSClipView object. Repeated invocations of this method (with an appropriate delay) result in continual scrolling, even when the mouse doesn’t move.