I'm creating a simple OS app but I cannot find anywhere how to take the resize event.
Let's assume that I wanna print the new width and height and I have this controller:
class ViewController: NSViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override var representedObject: AnyObject? {
didSet {
// Update the view, if already loaded.
}
}
}
What i have to add? Thank you.
My question is not the same as Listen for window resize event in Swift / Objective-C. Since my View have to extend NSViewController
and not NSWindowController
. This in his answer he did not explain what windowWillResize
has to return exactly