Instance Property

setScreen:

The screen on which the window is displayed.

Declaration

iOS, Mac Catalyst, tvOS
@property(nonatomic, strong) UIScreen *screen;
iOS, Mac Catalyst, tvOS
- (void)setScreen:(UIScreen *)screen;

Discussion

By default, this property is set to the primary device screen. If additional screens are attached to the device, you can assign a different screen object to display the window on that screen. A window is always displayed on only one screen.

Moving windows from screen to screen is a relatively expensive operation and should not be done in performance-sensitive code. Instead, it’s recommended that you change the screen before displaying the window the first time. Changing the screen of a window that has not yet been ordered onto the screen has no significant additional cost.

See Also

Configuring the Window

rootViewController

The root view controller for the window.

windowLevel

The position of the window in the z-axis.

UIWindowLevel

The positioning of windows relative to each other.

canResizeToFitContent

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