
Core Data
For apps still on Core Data rather than SwiftData, this covers the full persistence stack: setting up NSPersistentContainer, threading rules with perform blocks, NSFetchedResultsController for table views, and batch operations that run at SQL level. It includes iOS 17+ features like staged migrations and composite attributes, plus persistent history tracking for multi-target sync. The concurrency section is solid on the "never pass NSManagedObject across threads" rule and shows how to use objectID with Swift concurrency. If you're maintaining a Core Data codebase or need features SwiftData doesn't expose yet, this has the patterns you actually use in production, not just CRUD basics.
- skills.sh installs
- 2.8K
- GitHub stars
- 1.3K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add dpearson2699/swift-ios-skills --skill core-data --agent claude-codeInstalls into .claude/skills of the current project.
Files
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
- Concurrency and Threading
- NSFetchedResultsController
- Batch Operations
- Persistent History Tracking
- Staged Migration
- Composite Attributes
- SwiftData Boundary
- Testing
- Common Mistakes
- Review Checklist
- References
Stack Setup
NSPersistentContainer encapsulates the Core Data stack.
Docs: NSPersistentContainer
import CoreData
final class CoreDataStack: @unchecked Sendable {
static let shared = CoreDataStack()
let container: NSPersistentContainer
Sponsors
Details
- Repository
- github.com/dpearson2699/swift-ios-skills
- Categories
- DevOps & CI/CD, Git & Pull Requests, Code Review & Quality, Mobile Development
- First seen
- Jun 3, 2026
More from dpearson2699/swift-ios-skills
All 98- Focus Engine2.8K
- Ios Security1.1K
- Live Activities465
- Mapkit Location461
- Photos Camera Media456
- Eventkit Calendar415
- Cloudkit Sync413
- Metrickit Diagnostics409
- Musickit Audio409
- Realitykit Ar407
- Callkit Voip403
- Pencilkit Drawing403
- Homekit Matter402
- Passkit Wallet401
- Codable Patterns252
- Swiftui Animation5.7K
- Ios Accessibility5.2K
- Swiftui Performance4.8K
- App Store Review4.8K
- Swiftui Patterns4.7K
- Ios Networking4.6K
- Swiftui Navigation4.6K
- Swift Testing4.5K
- Ios Localization4.5K