Okay, that was much easier than I thought. The internet is full of tutorials about SwiftData, but this is the first vid I watched about storing simple values like config strings, integers, OAuth-keys and stuff like that. Extremely useful actually.Thank you!
Brilliant video. I wish I’d discovered this before wasting time battling with the much hyped SwiftData. I wish the WWDDC SwiftData vid had mentioned this capability, which is clearly a better option for singular data. 🐴Horses for courses.
Thanks Paul, this is a very useful video! I'm wondering I have only a few pieces of user data I'd like to save to the users device, how do I decide between using User Defaults and AppStorage?
Judging by what Paul said in the video, using @AppStorage is suited for individual pieces of data like variables and constants. If you had to store anything more complex (like a struct or a class, or a collection thereof), you're probably best service using UserDefaults.
Okay, that was much easier than I thought. The internet is full of tutorials about SwiftData, but this is the first vid I watched about storing simple values like config strings, integers, OAuth-keys and stuff like that. Extremely useful actually.Thank you!
bro this sheeesh crazy it worked like a buttercup with chicken holybadoly nice ty
skibidi diddly my chochancho gobancho
Brilliant video. I wish I’d discovered this before wasting time battling with the much hyped SwiftData. I wish the WWDDC SwiftData vid had mentioned this capability, which is clearly a better option for singular data.
🐴Horses for courses.
courses endorses
Thanks Paul, this is a very useful video! I'm wondering I have only a few pieces of user data I'd like to save to the users device, how do I decide between using User Defaults and AppStorage?
Judging by what Paul said in the video, using @AppStorage is suited for individual pieces of data like variables and constants. If you had to store anything more complex (like a struct or a class, or a collection thereof), you're probably best service using UserDefaults.
Can I use @AppStorage twice in my app in different places with the same key?
Yes, of course.