Swiftdata

Route SwiftData implementation tasks to the correct Knowledge Contracts -- declaring persistent model classes with @Model/@Attribute/@Relationship/@Transient, creating and injecting a ModelContainer/ModelConfiguration via .modelContainer, ModelContext CRUD (insert/delete/save/autosave/undo), fetching with @Query or FetchDescriptor+context.fetch(_:), and @Relationship(deleteRule:) referential integrity. Use when writing @Model class RemoteImage { ... }, @Attribute(.unique), @Relationship(deleteRule:inverse:), @Transient, ModelContainer(for:configurations:), ModelConfiguration(isStoredInMemoryOnly:), .modelContainer(for:)/.modelContainer(_:), @Environment(\.modelContext), context.insert(_:)/delete(_:)/save(), context.autosaveEnabled, context.undoManager, @Query(filter:sort:order:),

caglarbaranbora 3c78345 3.7 KB Updated

File contents

caglarbaranbora/Apple-Agent-Kit/tree/main/skills/swiftdata commit 3c783454f7

Frequently asked questions

npx skillmds@latest add caglarbaranbora/swiftdata