Class

UIImageConfiguration

A configuration object containing the traits that the system used when selecting the current image variant.

Declaration

@interface UIImageConfiguration : NSObject

Overview

Images may contain multiple variants to account for environmental factors, such as whether the interface is light or dark. The image configuration object lets you override the current environment and render an image with specific attributes. For example, you might want to render a specific version of your image to your interface.

UIImageConfiguration objects are immutable and you don't create them directly. Instead, get an existing image configuration object from a UITraitCollection or UIImage object. To add attributes to your configuration object, use the configurationByApplyingConfiguration: method to create a new object that merges the existing object's values with new values you supply. Assign the new object to the preferredSymbolConfiguration property of the UIImageView object you use to display the image. If you draw the image directly, use the imageWithConfiguration: method to create a new image that contains the new attributes.

Topics

Modifying a Configuration Object

- configurationByApplyingConfiguration:

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

- configurationWithTraitCollection:

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

Getting the Configuration Traits

traitCollection

The traits associated with the image configuration.

Relationships

Inherits From

See Also

Representations

UIImage

An object that manages image data in your app.

UIImageSymbolConfiguration

An object containing the specific font, size, style, and weight attributes to apply to a symbol image.