Class

UIImage.SymbolConfiguration

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

Declaration

class SymbolConfiguration : UIImage.Configuration

Overview

Symbol image configuration objects include details such as the point size, scale, text style, weight, and font to apply to your symbol image. The system uses these details to determine which variant of the image to use and how to scale or style the image.

UIImage.SymbolConfiguration objects are immutable after you create them. If you use the applying(_:) method on the object, the new image attributes replace any previous attributes you supplied. After creating a symbol configuration object, assign it to the preferredSymbolConfiguration property of the UIImageView object you use to display the image. If you draw the image directly, use the withConfiguration(_:) method to create a new image that contains the new attributes.

Topics

Creating a Symbol Configuration Object

init(pointSize: CGFloat)

Creates a configuration object with the specified point-size information.

init(pointSize: CGFloat, weight: UIImage.SymbolWeight)

Creates a configuration object with the specified point-size and weight information.

init(pointSize: CGFloat, weight: UIImage.SymbolWeight, scale: UIImage.SymbolScale)

Creates a configuration object with the specified point-size, weight, and scale information.

init(scale: UIImage.SymbolScale)

Creates a configuration object with the specified scale information.

init(textStyle: UIFont.TextStyle)

Creates a configuration object with the specified font text style information.

init(textStyle: UIFont.TextStyle, scale: UIImage.SymbolScale)

Creates a configuration object with the specified font text style and scale information.

init(weight: UIImage.SymbolWeight)

Creates a configuration object with the specified weight information.

init(font: UIFont)

Creates a new configuration object that with the specified font information.

init(font: UIFont, scale: UIImage.SymbolScale)

Creates a new configuration object with the specified font and scale information.

enum UIImage.SymbolScale

Constants indicating which scale variant of a symbol image to use.

enum UIImage.SymbolWeight

Constants indicating which weight variant of a symbol image to use.

Getting an Unspecified Configuration

class var unspecified: UIImage.SymbolConfiguration

A symbol configuration object containing unspecified values for all attributes.

Removing Configuration Attributes

func configurationWithoutPointSizeAndWeight() -> Self

Returns a copy of the current symbol configuration object without point-size and weight information.

func configurationWithoutScale() -> Self

Returns a copy of the current symbol configuration object without scale information.

func configurationWithoutTextStyle() -> Self

Returns a copy of the current symbol configuration object without text style information.

func configurationWithoutWeight() -> Self

Returns a copy of the current symbol configuration object without weight information.

Comparing Symbol Image Configurations

func isEqual(to: UIImage.SymbolConfiguration?) -> Bool

Returns a Boolean value indicating whether the configuration objects are equivalent.

Relationships

Conforms To

See Also

Changing the Image Attributes

func withConfiguration(UIImage.Configuration) -> UIImage

Returns a new version of the current image, replacing the current configuration attributes with the specified attributes.

func applyingSymbolConfiguration(UIImage.SymbolConfiguration) -> UIImage?

Returns a new version of the current image, applying the specified configuration attributes on top of the current attributes.

func imageFlippedForRightToLeftLayoutDirection() -> UIImage

Returns a new version of the current image, prepared to flip horizontally when it’s in a right-to-left layout.

func withHorizontallyFlippedOrientation() -> UIImage

Returns a new version of the image whose orientation is the mirror of the original image.

func withRenderingMode(UIImage.RenderingMode) -> UIImage

Returns a new version of the image configured with the specified rendering mode.

func withAlignmentRectInsets(UIEdgeInsets) -> UIImage

Returns a new version of the image that uses the specified alignment insets.

func resizableImage(withCapInsets: UIEdgeInsets) -> UIImage

Returns a new version of the image that contains the specified cap insets.

func resizableImage(withCapInsets: UIEdgeInsets, resizingMode: UIImage.ResizingMode) -> UIImage

Returns a new version of the image with the specified cap insets and options.

func imageWithoutBaseline() -> UIImage

Creates a copy of the current image object without any baseline information.

func withBaselineOffset(fromBottom: CGFloat) -> UIImage

Creates a new image with a baseline located at the specified offset from the bottom of the image.

class UIImage.Configuration

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