iOS Dev 27: UserDefaults for Data Persistence | Swift 5, XCode 12

preview_player
Показать описание
In this video, we learn how to persist data through app launches using the UserDefaults.

We start by learning how to store a value of a basic type (Boolean), then we move on to storing values of a custom structure type (User)

We also learn multiple ways of abstracting complexities either as an extension, or by creating a manager.

Additional Resources:

Say Hi on Social Media:

Video Content
1. Introduction 00:00
2. Project Setup & Reason for Data Persistence 0:42
3. Saving Data to UserDefaults Database 04:10
4. UserDefaults Extension 13:31
5. Storing a Custom Type 19:15
6. Conclusion 33:42
7. Bloopers 36:26
Рекомендации по теме
Комментарии
Автор

Good Morning Emmanuel. Great Stuff. I have a question. At 17:35, Please why is it that we cannot access the computed property isOn directly from the UserDefaults class since that is what we extended instead of going through the standard singleton?

olajideosho
Автор

cool! it's so helping. By the way, is there any source code for this tutorial? Thanks

soultanmuhammadalbar
Автор

what newValue ? for first open switch on.
thank you.

set {
UserDefaults.standard.setValue(newValue, forKey:
}

cancihancelebi
join shbcf.ru