Relative Content

Tag Archive for swiftdata

How to save a tree in SwiftData

I created a small sample app for saving and loading a tree using SwiftData, basically following this post. how-to-create-a-list-with-children-tree-from-swiftdata-model

SwiftData model context delete not working

In SwiftData I can’t get delete(model:where:includeSubclasses:) method to work. In the code example below I would expect both the School and its students to be deleted because of the cascade delete rule.

Renaming SwiftData model causing an error

I’m still working on my version 1.0.0 of my app so don’t yet need to migrate versions. I would like to rename my data model(s) but I get this error when running the app after changing the name of the model from SectionsSD to HelpSection

SwiftData Update Causing EXC_BAD_ACCESS Crash in SwiftUI App

I’m developing a SwiftUI application using SwiftData and I’m encountering a EXC_BAD_ACCESS crash when trying to update certain data in my app. Specifically, the crash occurs when I try to update the highlight attribute of TextSeg objects.

Setting up Query in init causes app to freeze

I’m trying to filter results to get all characters that are associated with a story. When navigating to the view it filters as it should, but as soon as you select the Add Character option, the app just freezes.

SwiftData – maintaining a local copy of server data

I’ve been going through SwiftData documentation, as I’m trying to learn how to work with SwiftData, especially how to use it to cache web responses. “Maintaining a local copy of server data” sample seems to be perfect source for me then, but I find it a little bit confusing, or lacking. There’s this function in file Quake+GeoFeatureCollection.swift: