I’m about to convert my ray-tracing app to a document-based app so users can multitask with more than one ray-tracing window at a time.
In the current single-window app, I use SwiftData to allow the app to persist its state between launches so the user can return to the same place he or she was at when they last quit the app.
However, I can’t seem to find any info about how to do this for a document-based app. Do I need to persist the document file names and locations so the app will launch with those files ready to use again? Or does the document framework code itself do this for me? Or should the app just launch without open files?
I’ve not done any work with SwiftData, but for document based apps, you just make sure you fill in how to open the document and how to save the document, the rest is taken care of for you.
Thanks, Sam. I’d read the Apple documentation, but somehow missed the Hacking with Swift article, which is more helpful, even though I visit that site often. I can get really stupid some migraine days.
Yes - Hacking with Swift, the lesson ‘How to create a document-based app with SwiftData’ was for me the key. I created a couple of apps with SwiftData (document based) - with the Apple Documentation only, I’m afraid I would no be able to do this