<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/ReadableDocument/reader(configuration:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI16ReadableDocumentP6reader13configuration6ReaderQzAA0D17ReadConfigurationVn_tF"
  },
  "title" : "reader(configuration:)"
}
-->

# reader(configuration:)

Creates a reader to load this document from disk.

```
func reader(configuration: sending Self.ReadConfiguration) -> sending Self.Reader
```

## Parameters

`configuration`

The content type of the file
being read.

## Discussion

SwiftUI calls this method each time it needs to read or
re-read the document (on open, or when another process
changes the file). Return a [`FileWrapperDocumentReader`](/documentation/SwiftUI/FileWrapperDocumentReader)
for cases that don’t require custom reading logic,
or a [`DocumentReader`](/documentation/SwiftUI/DocumentReader) for direct URL access.

---

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)