Instance Method


Returns a Boolean value that indicates whether a trait collection contains all of another trait collection’s values.


func containsTraits(in trait: UITraitCollection?) -> Bool



A trait collection that you want to compare to the current trait collection.

Return Value

This method returns true if the receiver contains all of the trait values in the trait collection passed in the trait parameter, and returns false otherwise.


Use this method to compare two standalone trait collections, or to compare the iOS interface environment’s trait collection to a standalone trait collection.

See Also

Comparing Trait Collections

func hasDifferentColorAppearance(comparedTo: UITraitCollection?) -> Bool

Returns a Boolean value indicating whether changing between the specified and current trait collections would affect color values.