DocumentCreationContext
Context about how a document was created.
Declaration
struct DocumentCreationContextOverview
SwiftUI passes this to the makeDocument closure of DocumentGroup. Use creationSource to determine which NewDocumentButton the person tapped and configure the document accordingly:
DocumentGroup { document in
EditorView(document: document)
} makeDocument: { configuration, context in
let document = NotesDocument()
if context.creationSource == .checklist {
document.template = .checklist
}
return document
}