Contents

AttributeScopes.SwiftUIAttributes.TrackingAttribute

A key for the space added between every character of a run of attributed text.

Declaration

@frozen enum TrackingAttribute

Overview

Tracking spreads a run out evenly, which suits a short label set in capitals. Give a positive value to open the run up and a negative value to tighten it:

var label = AttributedString("SOLD OUT")
label.tracking = 3

Text(label)

To adjust only the gap between particular pairs of letters, use AttributeScopes.SwiftUIAttributes.KerningAttribute.