Instance Property

keyWindow

The window that currently receives keyboard events.

Declaration

weak var keyWindow: NSWindow? { get }

Discussion

The value of this property is nil when there is no window receiving keyboard events. The property might be nil because the app’s storyboard file has not yet finished loading or when the receiver is not active.

See Also

Managing App Windows

var mainWindow: NSWindow?

The app’s main window.

func window(withWindowNumber: Int) -> NSWindow?

Returns the window corresponding to the specified window number.

var windows: [NSWindow]

An array of the app’s window objects.

func makeWindowsPerform(Selector, inOrder: Bool) -> NSWindow?

Sends the specified message to each of the app’s window objects until one returns a non-nil value.

Deprecated
struct NSApplication.WindowListOptions

This constant indicates a window ordering.