Contents

init(_:contentType:source:prepareDocumentURL:)

Creates and opens new URL-based documents from a template picker.

Declaration

nonisolated init(_ title: LocalizedStringKey, contentType: UTType, source: DocumentCreationSource, prepareDocumentURL: @escaping () async throws -> URL? = { nil })

Parameters

  • title:

    A title key for the button.

  • contentType:

    The content type of the document to create.

  • source:

    A source for the document creation flow. When a document is created, you can retrieve its source from Filedocumentconfiguration or Urldocumentconfiguration.

  • prepareDocumentURL:

    Called when the user taps the button.