Contents

init(id:)

Creates a document creation source with the given identifier.

Declaration

init(id: String)

Parameters

  • id:

    A string that uniquely identifies the creation flow within your app.

Discussion

Use different sources to distinguish between document creation flows in your app.

extension DocumentCreationSource {
    static let scanner: Self =
        DocumentCreationSource(id: "document-from-scanner")

    static let template: Self =
        DocumentCreationSource(id: "document-from-template")
}

DocumentGroupLaunchScene("Documents") {
    NewDocumentButton("Scan Document", source: .scanner)
    NewDocumentButton("New from Template", source: .template)
}

When a document is created, you can retrieve its source from URLDocumentConfiguration or FileDocumentConfiguration.