Protocol

UITraitEnvironment

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

Declaration

@protocol UITraitEnvironment

Overview

The iOS interface environment includes traits such as horizontal and vertical size class, display scale, and user interface idiom. To access the trait environment of an object that adopts this protocol, use the traitCollection property. The protocol also provides an overridable method that the system calls when the interface environment changes. Implement this method as part of creating an adaptive iOS app.

For more about trait collections, see UITraitCollection. For the WWDC 2014 presentation on creating adaptive interfaces in iOS, see Building Adaptive Apps with UIKit.

Topics

Accessing a Trait Collection

traitCollection

The traits, such as the size class and scale factor, that describe the current environment of the object.

Required.

Responding to a Change in the Interface Environment

- traitCollectionDidChange:

Called when the iOS interface environment changes.

Required.

Relationships

Inherits From

See Also

Adaptivity

Responding to Changing Display Modes on Apple TV

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

UITraitCollection

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

UIAdaptivePresentationControllerDelegate

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