Randy Randy - 1 year ago 181
Swift Question

Programmatically scroll NSScrollView to the right

Everything is in the title; I want to programmatically scroll an

to the right so I can see the end of my document.

I tried this :

let width = scrollView.frame.size.width
let height = scrollView.frame.size.height
let toRight = CGRectMake(width, 0, width, height)

But it didn't do anything.

Any help would be appreciated !

Answer Source

I finally got it to work by scrolling the content view :

scrollView.contentView.scrollPoint(NSPoint(width, 0))
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download