SwiftUI Data & ArchitectureLesson 54Free preview
Persistence
This lesson is part of Swift · All levels
Summary
This lesson is about light local data storage using UserDefaults on iOS. UserDefaults are specifically designed to store user preferences, application settings configurations, or simple status markers (such as onboarding status). The developer will learn the operation of reading, writing, and userdefaults capacity limitations.
Key points
- UserDefaults store the simple key-value pairs data in the application plist file
- Suitable for user preferences, application settings, and small data
- NOT designed to store large datasets or sensitive password data
- SwiftUI provides the property wrapper '@AppStorage' for automatic synchronization with UserDefaults
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.