<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/AttributedStringProtocol/unicodeScalars",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation24AttributedStringProtocolP14unicodeScalarsAA0bC0V17UnicodeScalarViewVvp"
  },
  "title" : "unicodeScalars"
}
-->

# unicodeScalars

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

```
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 <doc://com.apple.documentation/documentation/Swift/RangeReplaceableCollection> methods, such as `insert(_:at:)` and <doc://com.apple.documentation/documentation/Swift/RangeReplaceableCollection/append(_:)>. Inserted characters inherit any attributes present at the insertion point.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)