
Swiftdata
This covers the full SwiftData lifecycle: defining @Model classes with attributes and relationships, querying with @Query and #Predicate, managing concurrency with @ModelActor, and planning schema migrations with VersionedSchema. You'll reach for it when setting up persistence in a new iOS app, migrating from Core Data, or debugging why your relationships cascade incorrectly. The predicate syntax takes getting used to,it's expressive but limited compared to arbitrary Swift,and the migration examples show both lightweight and custom stages, which is helpful since Apple's docs gloss over the custom case. Solid reference when you're past the hello-world phase and need to handle real schema evolution or background imports.
- skills.sh installs
- 4.3K
- GitHub stars
- 1.3K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add dpearson2699/swift-ios-skills --skill swiftdata --agent claude-codeInstalls into .claude/skills of the current project.
Files
SwiftData
Persist, query, and manage structured data in iOS 26+ apps using SwiftData with Swift 6.3.
Contents
- Model Definition
- ModelContainer Setup
- CloudKit Sync
- CRUD Operations
@Query in SwiftUI- #Predicate
- FetchDescriptor
- Schema Versioning and Migration
- Core Data Coexistence Boundary
- Concurrency (
@ModelActor) - SwiftUI Integration
- Common Mistakes
- Review Checklist
- References
Model Definition
Apply @Model to a class (not struct). It synthesizes PersistentModel
conformance. Model instances remain context/actor-bound; pass their
PersistentIdentifier, not the instance, across actors.
Sponsors
Details
- Repository
- github.com/dpearson2699/swift-ios-skills
- Categories
- Git & Pull Requests, Code Review & Quality, Productivity & Planning, Marketing & SEO, Mobile Development
- First seen
- Apr 16, 2026
More from dpearson2699/swift-ios-skills
All 98- Debugging Instruments4.3K
- Swiftui Uikit Interop4.2K
- Storekit4.2K
- Widgetkit4.2K
- Swiftui Gestures4.2K
- Apple On Device Ai4.2K
- Swift Charts4.2K
- Swift Language4.1K
- App Intents4.1K
- Authentication4.1K
- Background Processing4.1K
- Healthkit4K
- Vision Framework4K
- Coreml3.9K
- Core Bluetooth3.9K
- Core Motion3.8K
- Natural Language3.8K
- Speech Recognition3.8K
- Device Integrity3.8K
- Contacts Framework3.8K
- Alarmkit3.8K
- Core Nfc3.8K
- Swift Codable3.8K
- Tipkit3.8K