Link Search Menu Expand Document

Window

The backdrop for your application’s user interface and the object that dispatches events to your views.

public class Window: View 

Inheritance

View

Initializers

init(frame:)

public init(frame: Rect) 

init(windowScene:)

Creates a Window and associates it with the specified scene object.

public init(windowScene: WindowScene) 

Properties

rootViewController

The root view controller for the window.

public var rootViewController: ViewController? 

windowLevel

The position of the window in the z-axis.

public var windowLevel: Window.Level = .normal 

screen

The screen on which the window is displayed.

@available(*, deprecated, message: "use windowScene.scene")
  public var screen: Screen 

canResizeToFitContent

A boolean value that indicates whether the window’s constraint-based content determines its size.

public var canResizeToFitContent: Bool = false 

isKeyWindow

A boolean value that indicates whether the window is the key window for the application.

public var isKeyWindow: Bool 

canBecomeKey

A boolean value that indicates whether the window can become the key window.

public var canBecomeKey: Bool = true 

windowScene

The scene containing the window.

public weak var windowScene: WindowScene? 

didBecomeVisibleNotification

Posted whn a Window object becomes visible.

public class var didBecomeVisibleNotification: NSNotification.Name 

didBecomeHiddenNotification

Posted when a Window object becomes hidden.

public class var didBecomeHiddenNotification: NSNotification.Name 

didBecomeKeyNotification

Posted whenever a Window object becomes the key window.

public class var didBecomeKeyNotification: NSNotification.Name 

didResignKeyNotification

Posted when a Window object resigns its status as main window.

public class var didResignKeyNotification: NSNotification.Name 

next

override public var next: Responder? 

isMinimizable

public var isMinimizable: Bool 

Methods

makeKeyAndVisible()

Shows the window and makes it the key window.

public func makeKeyAndVisible() 

makeKey()

Makes the receiver the key window.

public func makeKey() 

becomeKey()

Called automatically to inform the window that it has become the key window.

public func becomeKey() 

resignKey()

Called automatically to inform the window that it is no longer the key window.

public func resignKey()