Contents

UIConfigurationTextAttributesTransformer

Defines a text transformation that can affect the visual appearance of a string.

Declaration

struct UIConfigurationTextAttributesTransformer

Overview

Use a transformer to affect how your attributed text appears on the UI. You provide a closure when initializing the transformer. Your closure accepts a container with the current text attributes and returns a container with the new text attributes.

let transformer = UIConfigurationTextAttributesTransformer { incoming in
    var outgoing = incoming
    outgoing.foregroundColor = UIColor.black
    outgoing.font = UIFont.boldSystemFont(ofSize: 20)
    return outgoing
}

Topics

Creating a text attributes transformer

Defining a text transformation

Calling a text transformer

See Also

Configuring titles