Instance Property

windowNibName

The name of the document’s sole nib file.

Declaration

var windowNibName: NSNib.Name? { get }

Discussion

Using this name, NSDocument creates and instantiates a default instance of NSWindowController to manage the window. If your document has multiple nib files, each with its own single window, or if the default NSWindowController instance is not adequate for your purposes, you should override makeWindowControllers().

The default value of this property is nil. Subclasses must override it to specify a nib file name.

See Also

Creating and Managing Window Controllers

func makeWindowControllers()

Subclasses may override this method to create the initial window controller(s) for the document.

func windowControllerDidLoadNib(NSWindowController)

Sent after the specified window controller loads a nib file if the receiver is the nib file’s owner.

func windowControllerWillLoadNib(NSWindowController)

Sent before the specified window controller loads a nib file if the receiver is the nib file’s owner.

var windowControllers: [NSWindowController]

The document’s current window controllers.

func addWindowController(NSWindowController)

Adds the specified window controller to this document’s list of attached window controllers and sets the document of the passed-in window controller.

func removeWindowController(NSWindowController)

Removes the specified window controller from the receiver’s array of window controllers.

func shouldCloseWindowController(NSWindowController, delegate: Any?, shouldClose: Selector?, contextInfo: UnsafeMutableRawPointer?)

Invokes shouldCloseSelector with the result of canClose(withDelegate:shouldClose:contextInfo:) if the specified window controller that is closing is the last one or is marked as causing the document to close.