<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Text/Layout/CharacterIndex",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4TextV6LayoutV14CharacterIndexV"
  },
  "title" : "Text.Layout.CharacterIndex"
}
-->

# Text.Layout.CharacterIndex

The index of a character in the source text. An opaque
type, this is intended to be used to determine relative
locations of elements in the layout, rather than how they
map to the source strings.

```
@frozen struct CharacterIndex
```

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`Comparable`](/documentation/Swift/Comparable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Strideable`](/documentation/Swift/Strideable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`Sendable`](/documentation/Swift/Sendable)

[`Equatable`](/documentation/Swift/Equatable)

[`Copyable`](/documentation/Swift/Copyable)

---

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)