<!--
{
  "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/FileWrapperDocumentReader/init(_:makeSnapshot:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI25FileWrapperDocumentReaderV_12makeSnapshotACyxGAA0E17ReadConfigurationVn_xSo06NSFileD0CYaKYTctcfc"
  },
  "title" : "init(_:makeSnapshot:)"
}
-->

# init(_:makeSnapshot:)

Creates a reader that converts a `FileWrapper` into a snapshot.

```
init(_ configuration: sending FileWrapperDocumentReader<Snapshot>.ReadConfiguration, makeSnapshot: @escaping (FileWrapper) async throws -> sending Snapshot)
```

## Parameters

`configuration`

The read configuration passed to
[`reader(configuration:)`](/documentation/SwiftUI/ReadableDocument/reader(configuration:)).

`makeSnapshot`

A closure that deserializes the
`FileWrapper` into a snapshot. For flat files, read
`regularFileContents`. For packages, navigate
`fileWrappers` to find children. Throw an error if the
data is malformed.

---

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)