Reputation: 987
I have an NSWindow which is being shown using an NSWindowController. If I set the window level to anything but zero and then miniaturize and deminiaturize the window it disappears. The animation shows the window deminiaturizing but it disappears as soon as the animation ends.
class ViewController: NSViewController {
var controller:NSWindowController?
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override var representedObject: Any? {
didSet {
// Update the view, if already loaded.
}
}
@IBAction func buttonPressed(_ sender: Any) {
self.controller = NSWindowController(windowNibName: .init("FloatingWindowController"))
self.controller?.window?.level = .floating
self.controller?.showWindow(nil)
}
}
Upvotes: 3
Views: 142