One Logo Pool Ball
SwiftUI · IOS API REFERENCE

FileWrapperDocumentWriter

struct · iOS 27.0+ · SDK 27.1

struct FileWrapperDocumentWriter<Snapshot>

A document writer that serializes a snapshot into a `FileWrapper`. The `makeFileWrapper` closure in ``FileWrapperDocumentWriter/init(_:makeFileWrapper:)`` turns the document's snapshot into a `FileWrapper` that SwiftUI writes to disk. It receives the current snapshot and, when available, the `FileWrapper` from the document's last read or write. For documents written as a single file, ignore `previous` and return a freshly built wrapper: extension TextDocument: WritableDocument { func writer( configuration: sending WriteConfiguration ) -> sending FileWrapperDocumentWriter<String> { FileWrapperDocumentWriter(configuration) { snapshot, _ in FileWrapper(regularFileWithContents: Data(snapshot.utf8)) } } // ... }

Members (0)

This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

FileWrapperDocumentWriter.write(snapshot:to:previous:progress:)

The iOS SDK compiler rejected this binding: instance method 'arg' requires that 'Subprogress' conform to 'Copyable'

All SwiftUI types →