swiftdata-coredata-persistence
SwiftData & CoreData Persistence
Overview
SwiftData and CoreData are NOT interchangeable. Each has specific strengths, migration traps, and performance patterns. Wrong framework choice or migration strategy causes production crashes.
Core principle: Choose framework based on app constraints, version models from day one, never store BLOBs in the database.
Framework Selection
digraph framework_choice {
"New iOS app?" [shape=diamond];
"iOS 17+ only?" [shape=diamond];
"Simple data model?" [shape=diamond];
"iCloud sync?" [shape=diamond];
"Existing CoreData?" [shape=diamond];
"Use SwiftData" [shape=box, style=filled, fillcolor=lightgreen];
"Use CoreData" [shape=box, style=filled, fillcolor=lightblue];
More from dagba/ios-mcp
swiftui-performance-audit
Audit and improve SwiftUI runtime performance from code review and architecture. Use for requests to diagnose slow rendering, janky scrolling, high CPU/memory usage, excessive view updates, or layout thrash in SwiftUI apps, and to provide guidance for user-run Instruments profiling when code review alone is insufficient.
62swiftui-ui-patterns
Best practices and example-driven guidance for building SwiftUI views and components. Use when creating or refactoring SwiftUI UI, designing tab architecture with TabView, composing screens, or needing component-specific patterns and examples.
53programmatic-uikit-layout
Use when building UIKit interfaces without storyboards, setting up Auto Layout constraints with anchors, creating reusable UI components, or encountering layout constraint errors and ambiguous layout warnings
37macos-spm-app-packaging
Scaffold, build, and package SwiftPM-based macOS apps without an Xcode project. Use when you need a from-scratch macOS app layout, SwiftPM targets/resources, a custom .app bundle assembly script, or signing/notarization/appcast steps outside Xcode.
23swiftui-view-refactor
Refactor and review SwiftUI view files for consistent structure, dependency injection, and Observation usage. Use when asked to clean up a SwiftUI view’s layout/ordering, handle view models safely (non-optional when possible), or standardize how dependencies and @Observable state are initialized and passed.
23swift-codable-json
Use when implementing JSON encoding/decoding with Codable, handling API responses, encountering decoding errors, managing date formats, mapping snake_case to camelCase, or dealing with nested/inconsistent JSON structures
21