I have a Swift application that is launching a simple NSWindow
, like so:
func applicationDidFinishLaunching(notification: NSNotification!) {
let
In order to satisfy the two conditions identified in the accepted answer and comments, subclassing the window controller seems to work. You can then avoid setting this property uniquely in code for every window controller and simply specify the storyboard's window autosave property (and set the window controller's subclass).
The WindowController's windowFrameAutosaveName
must be
frameAutosaveName
class AutoFrameSavingWindowController: NSWindowController
{
override func awakeFromNib() {
if let autosaveName = window?.frameAutosaveName {
windowFrameAutosaveName = autosaveName + " temp"
}
}
}
}