App and Scenes

Manage life-cycle events for your app and respond to the creation of multiple instances of your app's UI.

Overview

In iOS 13 and later, the user can create and manage multiple instances of your app's user interface simultaneously, and switch between them using the app switcher. On iPad, the user can also display multiple instances of your app side by side. Each instance of your UI displays different content, or displays content in a different way. For example, the Calendar app can display the appointments for a specific day and for an entire month side by side.

UIKit manages each instance of your app's UI using a UIWindowScene object. A scene contains the windows and view controllers you need to present one instance of your UI. Each scene also has a corresponding UIWindowSceneDelegate object, which you use to manage all interactions with the scene. Because scenes run concurrently with each other in the same memory and app process space, a single app may have multiple scenes and scene delegate objects that are active simultaneously. To manage your app's scenes, use a UIApplicationDelegate object.

Topics

Essentials

Managing Your App's Life Cycle

Respond to system notifications when your app is in the foreground or background, and handle other significant system-related events.

Responding to the Launch of Your App

Initialize your app’s data structures, prepare your app to run, and respond to any launch-time requests from the system.

Preparing Your UI to Run in the Foreground

Configure your app to appear onscreen.

Preparing Your UI to Run in the Background

Prepare your app to be suspended.

Application

class UIApplication

The centralized point of control and coordination for apps running in iOS.

protocol UIApplicationDelegate

A set of methods that you use to manage shared behaviors for your app.

Scenes

Specifying the Scenes Your App Supports

Tell the system about your app’s scenes, including the objects you use to manage each scene and its initial user interface.

Supporting Multiple Windows on iPad

Use the UIScene lifecycle to support two side-by-side instances of your interface and learn how to create a new window with drag and drop.

protocol UIWindowSceneDelegate

Methods for managing a scene containing an app window.

Beta
protocol UISceneDelegate

Methods you use to respond to life-cycle events occurring within a scene.

Beta
class UIWindowScene

An instance of your app's user interface that manages one or more windows.

Beta
class UIScene

An instance of your app's user interface that's responsible for managing its content separately from other parts of your app.

Beta
class UISceneSession

An object containing information about one of your app's scenes.

Beta
class UISceneConfiguration

Information about the objects and storyboard for UKit to use when creating a particular scene.

Beta
class UISceneActivationConditions

The set of conditions that define when UIKit activates the current scene.

Beta
property list key UIApplicationSceneManifest

The information about the app's scene-based life-cycle support.

Name: Application Scene Manifest
Beta

Device Environment

class UIDevice

A representation of the current device.

class UIStatusBarManager

An object describing the configuration of the status bar.

Beta

Adaptivity

Responding to Changing Display Modes on Apple TV

Change images and resources dynamically when the screen gamut on your device changes.

class UITraitCollection

The iOS interface environment for your app, defined by traits such as horizontal and vertical size class, display scale, and user interface idiom.

protocol UITraitEnvironment

A collection of methods that makes the iOS interface environment available to your app.

protocol UIAdaptivePresentationControllerDelegate

A set of methods that, in conjunction with a presentation controller, determine how to respond to trait changes in your app.

Guided Access

protocol UIGuidedAccessRestrictionDelegate

A set of methods you use to add custom restrictions for the Guided Access feature in iOS.

static func guidedAccessRestrictionState(forIdentifier: String) -> UIAccessibility.GuidedAccessRestrictionState

Returns the restriction state for the specified guided access restriction.

Architecture

Updating Your App from 32-Bit to 64-Bit Architecture

Ensure that your app behaves as expected by adapting it to support later versions of the operating system.

Errors

enum UISceneError.Code

Error codes involving issues with scenes.

Beta
struct UISceneError

Errors returned during the creation or management of a scene.

Beta
let UISceneErrorDomain: String

The domain for scene-related errors.

Beta

See Also

App Structure

Documents, Data, and Pasteboard

Organize your app's data and share that data on the pasteboard.

Resource Management

Manage the images, strings, storyboards, and nib files that you use to implement your app's interface.

App Extensions

Extend your app's basic functionality to other parts of the system.

Inter-Process Communication

Share data through Handoff, support universal links into your app's content, and display activity-based services to the user.

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