Created
July 4, 2018 07:18
-
-
Save dinobei/16df749356876a9353fd6672281c3db9 to your computer and use it in GitHub Desktop.
Scrolling NSScrollView programatically (swift 4.0, cocoa in macOS)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ViewController { | |
... | |
override func viewDidAppear() { | |
... | |
// scrolling to top | |
scrollView.documentView?.scroll(NSPoint(x: 0, y: documentView.bounds.size.height)) | |
// scrolling to bottom | |
scrollView.documentView?.scroll(NSPoint.zero) | |
... | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment