搞定了 变成主窗口的事件获取NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(WindowBecameMain), name: NSWindowDidBecomeMainNotification, object: nil) 变成不是主窗口的事件获取NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(WindowResignMain), name: NSWindowDidResignMainNotification, object: nil)
搞定了
变成主窗口的事件获取
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(WindowBecameMain), name: NSWindowDidBecomeMainNotification, object: nil)
变成不是主窗口的事件获取
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(WindowResignMain), name: NSWindowDidResignMainNotification, object: nil)