---
title: "apply(snapshot:previous:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/readabledocument/apply(snapshot:previous:)"
---

# apply(snapshot:previous:)

Applies loaded content to the document model.

## Declaration

```swift
@MainActor func apply(snapshot: sending Self.Reader.Snapshot, previous: sending Self.Reader.Snapshot?) async throws
```

## Parameters

- `snapshot`: The snapshot loaded from disk.
- `previous`: The previously loaded snapshot. Compare to snapshot to update only what changed.

## Discussion

Discussion SwiftUI calls this method on the main actor after reading completes.

## See Also

### Reading a document

- [readableContentTypes](swiftui/readabledocument/readablecontenttypes.md)
- [ReadableDocument.ReadConfiguration](swiftui/readabledocument/readconfiguration.md)
- [Reader](swiftui/readabledocument/reader.md)
- [reader(configuration:)](swiftui/readabledocument/reader(configuration:).md)
