Is it possible to iterate over all open windows of any application in OSX and listen to their resize events in Swift? I want to create custom window manager that would move
first step,you should add NSWindowDelegate and function windowWillResize,full code like this:
class MainWindowController: NSWindowController, NSWindowDelegate {
override var windowNibName: String? {
return "MainWindowController"
}
override func windowDidLoad() {
super.windowDidLoad()
}
func windowDidResize(notification: NSNotification) {
//listen the event
}
}
then you should set the delegate property,set MainWindowController.xib include file window's delegate property to File's Owner.