When is Core Data worthwhile?
When Core Data (or SwiftData) is justified
- You have an object graph with relationships (user → orders → line items) that must be stored locally and queried by conditions.
- There's a lot of data: you need lazy loading, batching, indexes rather than "load everything into memory".
- The UI must react to data changes —
NSFetchedResultsController,@FetchRequest,@Query. - You need undo/redo, schema migrations, iCloud sync (
NSPersistentCloudKitContainer). - You don't want to write and maintain your own persistence layer — Core Data is mature, tested by Apple and free.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep