Thanks Stewart, markdown is an interesting option that I never considered. I've actually worked on some backend services where I embedded JSON Objects into a SQL database. Modern SQL databases even offer you abilities to query JSON using SQL, because sometimes you just want to store a JSON document, but not use a document DB. Something I've learnt from this exercise is always version your model, because it'll inevitably change and your app will need to know how to handle different versions of the data and automatically migrate it to the new version.
I like the way you used MarkDown with application data. I wonder what the limit is to the amount of data markdown can handle. Could markdown be used locally as a temp data store for the life of a user session? I've been trying to download and use JSON locally for life of a session but it seems to be slow and unreliable.
You would have to test and see. I have not had issues with JSON though as I keep the information in memory and only load on launch. All changes are saved as made.
You always give great hints to make coding easier. So, I wonder why auto-complete doesn't create do-catch blocks for you? Shouldn't you be able to type docatch, or some other shortcut and let Xcode auto complete this block for you?
I have a SwiftData question for you. Let say you have a Person struct: struct Person { ... person properties } would it be best to save objects of Person directly as Person or encoded JSON? does this save space and have shorter loading time when fetching?
The part about persisting is very useful, but the part about markdown is kind of overengineering (in my humble opinion), isn't it easier to just use appropriate JSON-editor, or simple code editor like VSCode? It has syntax highlighting and prettifier for JSON
Is JSON persistence as a way of persisting data possible in production apps? If you put this app on the app store where would a user's data actually get stored? I'm assuming it wouldn't be on your local computer's file directory? Is the JSON file stored somewhere on the user's local iOS device?
Another great video! One thing I couldn't get to work is right-clicking the path to my JSON file in the debug console and selecting "Services > Open". It opens a dialog with a "Run Service" button, but when I click that it opens a Finder window that just shows my home directory. I wonder if the problem is the permissions on my Library directory. I have "drwx------@". Are your permissions different from this?