Manage life-cycle events and your app’s UI scenes, and get information about traits and the environment in which your app runs.
Framework
- UIKit
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 the same content in a different way. For example, the user can display one instance of the Calendar app showing a specific day, and another showing an entire month.
UIKit communicates details about the current environment using trait collections, which reflect a combination of device settings, interface settings, and user preferences. For example, you use traits to detect whether Dark Mode is active for the current view or view controller. Consult the current trait collection of your UIView
or UIView
object when you want to customize its contents based on the current environment. Adopt the UITrait
protocol in other objects when you want them to receive trait notification changes.