Contents

unicodeScalars

The Unicode scalars of the attributed string, as a view into the underlying string.

Declaration

var unicodeScalars: AttributedString.UnicodeScalarView { get }

Discussion

Use this property when you want to split the attributed string by Unicode scalar instead of grapheme cluster. This is useful when you need to carefully control insertion points or render the content.

You can also use this property to mutate the attributed string, using RangeReplaceableCollection methods, such as insert(_:at:) and append(_:). Inserted characters inherit any attributes present at the insertion point.

See Also

Accessing Views into the Attributed String