<!--
{
  "availability" : [
    "iOS: 14.0.0 - 27.2.0",
    "iPadOS: 14.0.0 - 27.2.0",
    "macCatalyst: 14.0.0 - 27.2.0",
    "macOS: 11.0.0 - 27.2.0",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/ReferenceFileDocument/Snapshot",
  "metadataVersion" : "0.1.0",
  "role" : "Associated Type",
  "symbol" : {
    "kind" : "Associated Type",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI21ReferenceFileDocumentP8SnapshotQa"
  },
  "title" : "Snapshot"
}
-->

# Snapshot

A type that represents the document’s stored content.

```
associatedtype Snapshot
```

## Discussion

Define this type to represent all the data that your document stores.
When someone issues a Save command, SwiftUI asks your document for a
value of this type by calling the document’s [`snapshot(contentType:)`](/documentation/SwiftUI/ReferenceFileDocument/snapshot(contentType:))
method. SwiftUI sends the snapshot that you provide to the document’s
[`fileWrapper(snapshot:configuration:)`](/documentation/SwiftUI/ReferenceFileDocument/fileWrapper(snapshot:configuration:)) method, where you serialize
the contents of the snapshot into a file wrapper.

---

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)