Instance Property

traitCollection

The trait collection for a view controller (an instance of the UIViewController class or one of its subclasses) or a view (an instance of the UIView class or one of its subclasses).

Required.

Declaration

var traitCollection: UITraitCollection { get }

Discussion

The UITraitEnvironment protocol is adopted by view controllers and views.