<!--
{
  "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/AttributedString/FormattingOptions",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation16AttributedStringV17FormattingOptionsV"
  },
  "title" : "AttributedString.FormattingOptions"
}
-->

# AttributedString.FormattingOptions

Options that affect the handling of attributes.

```
struct FormattingOptions
```

## Topics

### Creating Formatting Options

[`init()`](/documentation/Foundation/AttributedString/init())

Creates an empty attributed string.

[`init(NSAttributedString)`](/documentation/Foundation/AttributedString/init(_:)-1fru0)

Creates a value-type attributed string from a reference type.

[`init(AttributedSubstring)`](/documentation/Foundation/AttributedString/init(_:)-8tnoq)

Creates an attributed string from an attributed substring.

### Using Defined Formatting Options

[`static let applyReplacementIndexAttribute: AttributedString.FormattingOptions`](/documentation/Foundation/AttributedString/FormattingOptions/applyReplacementIndexAttribute)

An option to add an attribute that marks replacements in localized strings.

### Performing Set Operations

## Relationships

### Conforms To

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

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

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

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

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

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

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

---

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)