Customize DocumentGroup in SwiftUI with SwiftData

How do I customize my app's startup experience when using DocumentGroup in SwiftUI with SwiftData?

I don't want my users to be greeted with a document browser on startup.

Rather, I want to offer an experience like PhotoShop where the user is greeted by an "empty" version of my app's editor view. They can then use something like File->New or File->Open to get started.

Post not yet marked as solved Up vote post of Goatma Down vote post of Goatma
755 views

Replies

You can have a window group as your primary UI and then explicitly open the DocumentGroup to open a new or existing document. I have not found a way to create a document and save it to disk without the Apple UI, unless you use an exporter UI. In either case apple will control the file dialog so you are not able to access arbitrary files.

  • It sounds like the thing I want with my app. How do you "open the DocumentGroup to open a new or existing document"? I can't seem to find a way to open the DocumentGroup with a specific document/Model from my main WindowGroup.

Add a Comment