I tried something like this (see below), but always the first DocumentGroup will be executed and not the second one, that means whenever I press on '+' or select a document it will execute "DocumentGroup(viewing:DocumentAppDocuments)". How can I distinguish here? Or is this a current issue of the beta version?
@main
Code Block struct DocumentApp: App { |
|
@SceneBuilder var body: some Scene { |
|
// Viewing of document |
|
DocumentGroup(viewing:DocumentAppDocuments ) { file in |
|
DocumentPreview(document: file.$document) |
|
} |
|
// Adding of a new document |
|
DocumentGroup(newDocument: DocumentAppDocuments()) { file in |
|
ContentView(document: file.$document) |
|
} |
|
} |
|
} |