Contents

apply(snapshot:previous:)

Applies loaded content to the document model.

Declaration

@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

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

See Also

Reading a document