persistence

Core Data for local persistence

Core Data is Apple's object graph and persistence framework, essential for complex data models and offline support. I define entities and relationships in the .xcdatamodeld file, then generate NSManagedObject subclasses. The NSPersistentContainer enca

UserDefaults and app preferences

UserDefaults provides simple key-value storage for app preferences and settings. It persists basic types like strings, numbers, bools, dates, and data automatically. I use UserDefaults for user preferences, app state, and feature flags—never for sensi

Room database for local persistence

Room provides an abstraction layer over SQLite for compile-time verified database access. I define entities with @Entity annotation, specifying table structure and relationships. DAOs (Data Access Objects) marked with @Dao contain query methods using