init(source:)
Creates and opens new documents from a specified source.
Declaration
nonisolated init(source: NewDocumentButtonDataSource)Parameters
- source:
A source of data that fills the newly created document.
Discussion
The button creates new documents of the writable content types of all the document types supported by DocumentGroups in the App definition. If a document type is not associated with any DocumentGroup, the button won’t create new documents of that type.
The framework watches for the relevant content types on the pasteboard. When there are no matching or conforming types, the button is disabled.