Contents

init(allowCreating:editor:makeDocument:)

Creates a document group capable of creating, viewing, and editing documents.

Declaration

nonisolated init(allowCreating: Bool = true, @ContentBuilder editor: @escaping (Document) -> Content, makeDocument: @escaping (URLDocumentConfiguration, DocumentCreationContext) async throws -> Document)

Parameters

  • allowCreating:

    Whether the document group supports creating new documents in addition to opening and editing existing ones.

  • editor:

    The editing UI for the provided document.

  • makeDocument:

    A closure that creates the document instance. Throw CancellationError to indicate that document creation was cancelled.