Instance Method


Returns a new configuration object that merges the current traits with the traits from the specified trait collection.


func withTraitCollection(_ traitCollection: UITraitCollection?) -> Self



The traits to insert or apply to the configuration object. The trait values in this parameter take precedence over the ones in the current configuration object, unless you left the trait with an unspecified value.

Return Value

A configuration object with the merged set of traits.


Use this method to augment or change the traits in the current configuration object. This method prefers the values from traitCollection over the values in the current configuration object. If the value of the trait is unspecified in both collections, it remains unspecified in the new collection.

See Also

Modifying a Configuration Object

func applying(UIImage.Configuration?) -> Self

Returns a configuration object that applies the specified configuration values on top of the current object's values.