Instance Property

rootViewController

The root view controller for the window.

Declaration

var rootViewController: UIViewController? { get set }

Discussion

The root view controller provides the content view of the window. Assigning a view controller to this property (either programmatically or using Interface Builder) installs the view controller’s view as the content view of the window. The new content view is configured to track the window size, changing as the window size changes. If the window has an existing view hierarchy, the old views are removed before the new ones are installed.

The default value of this property is nil.

See Also

Configuring the Window

var windowLevel: UIWindow.Level

The position of the window in the z-axis.

struct UIWindow.Level

The positioning of windows relative to each other.

var screen: UIScreen

The screen on which the window is displayed.

Deprecated
var canResizeToFitContent: Bool

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

Beta

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software