Initializer

init(displayScale:)

Returns a new trait collection containing only a specified display scale.

Declaration

init(displayScale scale: CGFloat)

Parameters

scale

The display scale for the new trait collection. Use 1.0 to specify a non-Retina display scale, and a value of 2.0 or greater to specify a Retina display scale.

Return Value

A new trait collection containing only a specified display scale trait.

See Also

Creating a Trait Collection

init()

Returns a new trait collection whose traits are set to their default (unspecified) values.

init(traitsFrom: [UITraitCollection])

Returns a new trait collection consisting of traits merged from a specified array of trait collections.

init(userInterfaceIdiom: UIUserInterfaceIdiom)

Returns a new trait collection containing only a specified interface idiom.

init(horizontalSizeClass: UIUserInterfaceSizeClass)

Returns a new trait collection containing only a specified horizontal size class.

init(verticalSizeClass: UIUserInterfaceSizeClass)

Returns a new trait collection containing only a specified vertical size class.

init(forceTouchCapability: UIForceTouchCapability)

Creates a trait collection containing only a specified force touch capability trait.

init(displayGamut: UIDisplayGamut)

Returns a new trait collection containing only the specified display gamut trait.

init(layoutDirection: UITraitEnvironmentLayoutDirection)

Returns a new trait collection containing only the specified layout direction trait.

init(preferredContentSizeCategory: UIContentSizeCategory)

Returns a new trait collection containing only the specified content size category trait.

init(userInterfaceStyle: UIUserInterfaceStyle)

Returns a new trait collection containing only the specified user interface style trait.