How can I resize NSScrollView using Swift?
class MainViewController: NSViewController {
@IBOutlet weak var scrollView: NSScrollView!
override func viewDidLoad {
scrollView.setFrameOrigin(NSPoint(x: 340, y: 537))
scrollView.setFrameSize(CGSize(width: scrollView.contentSize.width, height: 102.0))
}
}
The above code works only if there are no constraints set. But, without constraints, the ScrollView doesn't stay in place when the window is resized.