AppleTraitCollection - UBogun/Xojo-iosLib GitHub Wiki

Inherits from AppleObject
Memory leak check: not yet done.
Status: complete
iOS 8 and above only!

A trait collection describes the interface design in an app – display scale, orientation and interface idiom. It helps Views to react on orientation changes, but only from iOS 8 on. See UITraitCollection / Apple Docs.

Constructors

Constructor (TraitCollection As AppleArray of AppleTraitCollection): Creates a new trait collection consisting of traits merged from a specified array of trait collections.

Constructor (DisplayScale As Double): Creates a new trait collection containing only a specified display scale.

Constructor (UserInterfaceIdiom as UIUserInterfaceIdiom): Returns a new trait collection containing only a specified interface idiom.

Properties

DisplayScale As Double (read-only): A value of 1.0 indicates a non-Retina display and a value of 2.0 indicates a Retina display. The default display scale for a trait collection is 0.0 (indicating unspecified).

HorizontalSizeClass As UIUserInterfaceSizeClass (read-only): The horizontal size class of the trait collection. Default Undefined.

UserInterfaceIdiom As UIUserInterfaceIdiom (read-only): The user interface idiom of the trait collection.

VerticalSizeClass As UIUserInterfaceSizeClass (read-only): The vertical size class of the trait collection. Default Undefined.

Methods

ContainsTraitsInCollection (Collection as AppleTraitCollection) As Boolean: True if a trait collection contains all of another trait collection’s values.

##Shared Methods HorizontalSizedClass (HorizontalClass As UIUserInterfaceSizeClass) As AppleTraitCollection: Returns a new trait collection containing only a specified horizontal size class.

VerticalSizedClass (VerticalClass As UIUserInterfaceSizeClass) As AppleTraitCollection: Returns a new trait collection containing only a specified vertical size class.