<!--
{
  "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/AttributeScopes/FoundationAttributes/ReplacementIndexAttribute",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation15AttributeScopesO0A10AttributesV016ReplacementIndexB0O"
  },
  "title" : "AttributeScopes.FoundationAttributes.ReplacementIndexAttribute"
}
-->

# AttributeScopes.FoundationAttributes.ReplacementIndexAttribute

A type for using a replacement index as an attribute.

```
@frozen enum ReplacementIndexAttribute
```

## Overview

When you use the [`applyReplacementIndexAttribute`](/documentation/Foundation/AttributedString/FormattingOptions/applyReplacementIndexAttribute) formatting option, the resulting formatted string uses this attribute to mark the location of replacement strings. This allows you to relate ranges to replacements even if localizers change the word order in format strings.

## Relationships

### Conforms To

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

[`EncodableAttributedStringKey`](/documentation/Foundation/EncodableAttributedStringKey)

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

[`AttributedStringKey`](/documentation/Foundation/AttributedStringKey)

[`DecodableAttributedStringKey`](/documentation/Foundation/DecodableAttributedStringKey)

[`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)