swiftdata-inheritance
Installation
SKILL.md
SwiftData Class Inheritance
Guide for implementing class inheritance in SwiftData models. Covers when to use inheritance versus enums or protocols, how to annotate subclasses, query across hierarchies, and avoid common pitfalls with schema migrations and relationship modeling.
When This Skill Activates
- User is designing a SwiftData model hierarchy with shared base properties
- User asks about
@Modelon subclasses or how inheritance works in SwiftData - User needs to query across a type hierarchy (all trips vs only business trips)
- User is deciding between inheritance, enums, or protocols for model variants
- User has issues with polymorphic relationships or type casting in SwiftData
- User is migrating a Core Data inheritance hierarchy to SwiftData