NSScrollView scrollToTop
Finally figured it out. Works like a charm!
if ([self hasVerticalScroller]) {
self.verticalScroller.floatValue = 0;
}
NSPoint newOrigin = NSMakePoint(0, NSMaxY(((NSView*)self.documentView).frame) - self.boundsHeight);
[self.contentView scrollToPoint:newOrigin];
Updated for Swift 5:
If your document view is flipped:
scrollView.documentView?.scroll(.zero)
otherwise:
if let documentView = scrollView.documentView {
documentView.scroll(NSPoint(x: 0, y: documentView.bounds.size.height))
}