<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSAttributedString/TextLayoutSectionKey",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@T@NSTextLayoutSectionKey"
  },
  "title" : "NSAttributedString.TextLayoutSectionKey"
}
-->

# NSAttributedString.TextLayoutSectionKey

Constants for the text layout sections document attribute key.

```
struct TextLayoutSectionKey
```

## Overview

Use these constants as values for the [`textLayoutSections`](/documentation/Foundation/NSAttributedString/DocumentAttributeKey/textLayoutSections) key in the document attributes dictionary.

## Topics

### Getting keys for text layouts

[`static let orientation: NSAttributedString.TextLayoutSectionKey`](/documentation/Foundation/NSAttributedString/TextLayoutSectionKey/orientation)

The orientation of the text.

[`static let range: NSAttributedString.TextLayoutSectionKey`](/documentation/Foundation/NSAttributedString/TextLayoutSectionKey/range)

The character range.

### Initializers

[`init(rawValue: String)`](/documentation/Foundation/NSAttributedString/TextLayoutSectionKey/init(rawValue:))

Creates a text layout section key with the specified raw value.

## Relationships

### Conforms To

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

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

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

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

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

---

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)