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


protocol UIAdaptivePresentationControllerDelegate


After implementing an object that conforms to this protocol, assign that object to the delegate property of an appropriate UIPresentationController object. Your delegate can suggest a new presentation style or an entirely new view controller for displaying content. For more information about using the delegate to respond to size class changes, see UIPresentationController.


Adapting the Presentation Style

func adaptivePresentationStyle(for: UIPresentationController, traitCollection: UITraitCollection) -> UIModalPresentationStyle

Asks the delegate for the presentation style to use when the specified set of traits are active.

Adapting the View Controller

func presentationController(UIPresentationController, viewControllerForAdaptivePresentationStyle: UIModalPresentationStyle) -> UIViewController?

Asks the delegate for the view controller to display when adapting to the specified presentation style.


Inherits From

See Also

Device Environment

Responding to Changing Display Modes on Apple TV

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

class UIDevice

A representation of the current device.

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.