---
title: unicodeScalars
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/attributedstring/unicodescalars
---

# unicodeScalars

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

## Declaration

```swift
var unicodeScalars: AttributedString.UnicodeScalarView { get set }
```

## Discussion

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

- [characters](foundation/attributedstring/characters.md)
- [AttributedString.CharacterView](foundation/attributedstring/characterview.md)
- [AttributedString.UnicodeScalarView](foundation/attributedstring/unicodescalarview.md)
- [runs](foundation/attributedstring/runs-swift.property.md)
- [AttributedString.Runs](foundation/attributedstring/runs-swift.struct.md)
