Instance Method


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


- (BOOL)containsTraitsInCollection:(UITraitCollection *)trait;



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

Return Value

This method returns YES if the receiver contains all of the trait values in the trait collection passed in the trait parameter, and returns NO 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

- hasDifferentColorAppearanceComparedToTraitCollection:

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