swiftdata
Installation
SKILL.md
SwiftData (iOS 17+)
Overview
SwiftData is Apple's modern persistence framework (iOS 17+), built on Core Data but Swift-native. You declare models with the @Model macro; a ModelContainer holds the store, a ModelContext performs inserts/updates/deletes, and @Query drives SwiftUI views reactively.
When to use
- Local persistence in a native iOS app (iOS 17+)
- SwiftUI-driven, reactive data display
- Migrating from Core Data to a Swift-native API
- NOT for code shared with Android → use
sqldelight-patterns
Model
import SwiftData