window
The window owned by the receiver.
Declaration
var window: NSWindow? { get set }Discussion
Accessing this property loads the nib file if there is one and it has not yet been loaded. If the window was loaded, the following methods are called in order: windowWillLoad(), loadWindow(), and windowDidLoad(). If the window controller has a document, the document’s corresponding methods windowControllerWillLoadNib(_:) and windowControllerDidLoadNib(_:) are also called (if implemented). To affect nib loading or do something before or after it happens, you should always override these methods.
Setting this property releases the window controller’s old window along with any associated top-level objects in its nib file, and establishes ownership of the specified new window. Typically, you should not use this property to set the window. Instead, create a new window controller for the new window and then release the old window controller.