UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

App Storage permanence

Forums > SwiftUI

Is AppStorage reliable?

I was/am considering using it for some app preference settings so for each instance of my app these can be unique and saved.

My app is a editor and so that would equate be things like navagator sidebar format (font, size, weight, color, etc), inspector (righrt sidebar) would have it's own formating, Default settings for the editor.

This has two potential issues. 1. ALL books would have the same settings. 2. Moving the app to another machine requires I carry around the preferences, and 3. Shared/collaborative authors would have to sync the formating preferences (or not - depending on what they want).

So, is it reliable? Meaning. If my Mac goes to the great recycle bin in the sky, will my new mac KNOW the preferences, or do I need to provide a method to bring them along?

The other option is to provide a preferences model struture that the document updates on a per book basis, and that would get persistance, potability, and sharing solution all at once.

If my "thoughts" above are true, then I wonder why have AppStorage? If you need persistence in an APP, why not just use it for anything that has to survive relaunch, sharing, colaboration, and moving to another machine.

Suggestions? Thoughts?

1      

Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.