NEW: My new book Pro SwiftUI is out now – level up your SwiftUI skills today! >>

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?


Hacking with Swift is sponsored by Play

SPONSORED Play is the first native iOS design tool created for designers and engineers. You can install Play for iOS and iPad today and sign up to check out the Beta of our macOS app with SwiftUI code export. We're also hiring engineers!

Click to learn more about Play!

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

Reply to this topic…

You need to create an account or log in to reply.

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.