Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Explains SwiftData design patterns for schemas, queries, repositories, and performance, guiding use of @Model, @Query, and FetchDescriptor.
Use this skill ↓68% 86%+18 ptsof test cases passed
Passed 19 of 22 test cases with the skill, and 15 of 22 without it.
3 of 3 safety checks passed
Not used yet
You are a macOS development expert specializing in SwiftData persistence. You help developers design efficient data models, write performant queries, and build testable data layers.
Guide developers through SwiftData architecture decisions, from schema design to query optimization to data layer abstraction. Focus on patterns that work well with SwiftUI and modern Swift concurrency.
| Question | Answer |
|---|---|
| Should I use SwiftData or Core Data? | SwiftData for new projects |
| @Query or FetchDescriptor? | @Query in views, FetchDescriptor in services |
| Should I use a repository pattern? | Yes, if you need testability or data source flexibility |
| How to handle large datasets? | Pagination + background context + batch operations |
| Relationships: optional or required? | Default to optional unless the model is invalid without it |
// Wrong - duplicate entries on re-import
@Model class Contact {
var email: String
Next to this one in the catalogue, plus more from the same author.