Initializer

init(verticalSizeClass:)

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

Declaration

init(verticalSizeClass: UIUserInterfaceSizeClass)

Parameters

verticalSizeClass

A UIUserInterfaceSizeClass value specifying the vertical size class for the new trait collection.

Return Value

A new trait collection containing only a specified vertical size class 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(userInterfaceStyle: UIUserInterfaceStyle)

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

init(accessibilityContrast: UIAccessibilityContrast)

Returns a new trait collection containing only the specified accessibility contrast trait.

Beta
init(userInterfaceLevel: UIUserInterfaceLevel)

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

Beta
init(legibilityWeight: UILegibilityWeight)

Returns a new trait collection containing only the specified legibility weight trait.

Beta
init(forceTouchCapability: UIForceTouchCapability)

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

init(displayScale: CGFloat)

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

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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software