← ClaudeAtlas

core-datalisted

Build or review persistence in apps that still use Core Data, including managed objects, fetched results, batch operations, persistent history, staged migration, and concurrency. Use for Core Data-only work; route SwiftData adoption or coexistence to swiftdata.
thiennc-tesoglobal/ios-skills · ★ 3 · Data & Documents · score 66
Install: claude install-skill thiennc-tesoglobal/ios-skills
# Core Data Build and maintain data persistence using Core Data for apps that have not adopted SwiftData. Covers stack setup, concurrency, batch operations, NSFetchedResultsController, persistent history tracking, staged migration, and testing. ## Contents - [Stack Setup](#stack-setup) - [Concurrency and Threading](#concurrency-and-threading) - [NSFetchedResultsController](#nsfetchedresultscontroller) - [Batch Operations](#batch-operations) - [Persistent History Tracking](#persistent-history-tracking) - [Staged Migration](#staged-migration) - [Composite Attributes](#composite-attributes) - [SwiftData Boundary](#swiftdata-boundary) - [Testing](#testing) - [Common Mistakes](#common-mistakes) - [Review Checklist](#review-checklist) - [References](#references) ## Stack Setup `NSPersistentContainer` encapsulates the Core Data stack. Docs: [NSPersistentContainer](https://sosumi.ai/documentation/coredata/nspersistentcontainer) ```swift import CoreData final class CoreDataStack: @unchecked Sendable { static let shared = CoreDataStack() let container: NSPersistentContainer private init() { container = NSPersistentContainer(name: "MyAppModel") container.loadPersistentStores { _, error in if let error { fatalError("Core Data store failed: \(error)") } } container.viewContext.automaticallyMergesChangesFromParent = true container.viewContext.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy } var viewCo