Instance Property

traitCollection

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

Required.

Declaration

var traitCollection: UITraitCollection { get }

Discussion

UIViewController and UIView adopt the UITraitEnvironment protocol and expose this property.