Instance Property

overrideTraitCollection

Interface traits for the presented view controller, to use in place of traits from the iOS environment.

Declaration

@NSCopying var overrideTraitCollection: UITraitCollection? { get set }

Discussion

Use this property to provide an interface trait collection for the presented view controller, overriding one or more values in the iOS trait environment.

Each value you place in the overrideTraitCollection property overrides the corresponding value in the iOS trait environment. For example, the following code snippet shows how to override the display scale for the presented view controller, leaving other traits as they are provided by the system. Place such code, typically, in the implementation file for the presenting view controller:

presentedVC.presentationController.overrideTraitCollection = [UITraitCollection traitCollectionWithDisplayScale: 1.5];
[self presentViewController: presentedVC animated: NO completion: nil];

The presenting view controller is not affected by use of this property.

The default value of the overrideTraitCollection property is nil, which results in the full iOS trait environment being used by the presented view controller.

See Also

Adjusting the Size and Layout of the Presentation

var frameOfPresentedViewInContainerView: CGRect

The frame rectangle to assign to the presented view at the end of the animations.

func containerViewWillLayoutSubviews()

Notifies the presentation controller that layout is about to begin on the views of the container view.

func containerViewDidLayoutSubviews()

Called to notify the presentation controller that layout ended on the views of the container view.