How to programmatically show a DocumentGroup?

61 Views Asked by At

WindowGroups have ids, like this: WindowGroup(id: "window_id"), but DocumentGroups do not have an id. So opening like this does not work: openWindow(id: "window_id").

The problem is that if the user dismisses the DocumentGroup, there is no way to reopen it again.

DocumentGroup(newDocument: { TestDocument() }) { file in // When it is dismissed, there is no way to bring it back.
    ContentView()
}

WindowGroup(id: "TestWindow") { // I can bring it back by opening it with its ID.
    TestWindowView()
}
.windowStyle(.plain)
0

There are 0 best solutions below