<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSAttributedString/DocumentReadingOptionKey/documentType",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Foundation",
      "UIKit"
    ],
    "preciseIdentifier" : "c:@NSDocumentTypeDocumentOption"
  },
  "title" : "documentType"
}
-->

# documentType

The document type.

```
static let documentType: NSAttributedString.DocumentReadingOptionKey
```

## Discussion

One of the document types described in [`NSAttributedString.DocumentType`](/documentation/Foundation/NSAttributedString/DocumentType), indicating a document type to be forced when loading the document. The previous string constant was `@"DocumentType"`.

---

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)