Contents

init(systemName:variableValue:configuration:)

Creates an image object that contains a system symbol image with the configuration and variable value you specify.

Declaration

convenience init?(systemName name: String, variableValue: Double, configuration: UIImage.Configuration? = nil)

Parameters

  • name:

    The name of the system symbol image.

  • variableValue:

    The value the system uses to customize the image content, between 0 and 1.

  • configuration:

    The image configuration the system applies to the image.

Return Value

The object containing the image variant that matches the specified configuration data, or nil if no suitable image was found.

Discussion

Use this method to retrieve system-defined symbol images. To retrieve a custom symbol image you store in an asset catalog, use the init(named:in:variableValue:configuration:) method instead.

This method checks the system caches for an image with the specified name and returns the variant of that image that’s best suited for the configuration you specify. If a matching image object isn’t in the cache, this method creates the image from the system symbol image.

The system may purge cached image data at any time to free up memory. Purging occurs only for unused images that are in the cache.

To look up the names of system symbol images, download the SF Symbols app from Apple Design Resources.

See Also

Loading and caching images