Using Windows to Present Content on Multiple Displays
Every iOS app has a window that handles the presentation of the appâs user interface. Although the window provides crucial functionality, most apps never need to access it. Typically, only an app that supports an external display needs to interact with a window.
At a Glance
In iOS, the window object contains an appâs views and manages their presentation on the device display. The windowâs associated screen object represents the specific device display currently in use. If your app allows users to view content on an external display, you create another window object to manage the presentation of content on that display.
Windows Provide Important Functionality to Your App
In addition to containing your appâs visible content, windows are involved in delivering touch events to your views and responding to orientation changes. A windowâs associated screen object provides information about the device display currently being used. When you use storyboards to define your appâs user interface, the main storyboard automatically sets up the window that manages content display on the device.
An Additional Window Is Needed to Support an External Display
If your app supports an external device display, you need to create a separate window object to represent the content to display on it. You can show the same content on both displaysâthis feature is called mirroring and it happens by defaultâor you can show different content on each display.
See Also
App Programming Guide for iOS describes the fundamental architecture of an iOS app and provides coding guidelines and best practices that help your develop great apps.
AirPlay Overview describes how to provide AirPlay-compatible media to iOS-based devices.
UIWindow Class Reference describes the programming interfaces of the UIWindow class.
UIScreen Class Reference describes the programming interfaces of the UIScreen class.
Copyright © 2012 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2012-12-13