---
title: "write(content:to:previous:progress:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/documentwriter/write(content:to:previous:progress:)"
---

# write(content:to:previous:progress:)

Writes the document content to disk.

## Declaration

```swift
nonisolated func write(content: sending Self.Snapshot, to destination: sending Self.Destination, previous: sending Self.Snapshot?, progress: consuming Subprogress) async throws
```

## Parameters

- `content`: The content to write to disk.
- `destination`: The destination to write to.
- `previous`: The previously written content. Use it to skip writing unchanged data.
- `progress`: The subprogress to report writing progress to SwiftUI.

## See Also

### Writing a document

- [Snapshot](swiftui/documentwriter/snapshot.md)
- [Destination](swiftui/documentwriter/destination.md)
