I'm trying to get an NSWindow to appear when the respective button for that window is clicked (about -> aboutWindow, preferences -> preferencesWindow). When I click the button to open the window(s), though, they flash and then disappear. I saw a post or two about this describing how to fix it, but it was relatively vague, as well as explained in Objective-C, not Swift. I think I know what the problem is (instance created inside the @IBAction
, getting rid of the instance once the action has finished), but I'm not sure how to fix it.
All code is over at https://github.com/madebybright/Nimble/tree/windows
An explanation for the fix would be much appreciated.