SwiftData mode does not update the view when I insert child records
I have a problem with SwiftData and inserting child records. The insert itself works but the views are not updated. If I add a new court
record in DetailView
, tournament.title
in ContentView
changes to Tournament with new court but tournament.courts.count
is still 1
and not 2
, 3
, … Also the List
in DetailView
shows only the initial court and not the new added.
draggable/dropDestination causing runtime error (EXC_BAC_ACCESS)
I feel like I’m missing something here but can’t figure it out.
I’ve got two SwiftData models joined as a relationship. The idea being that the user drags the name of a device from a list and they can drop it into the view.
Storing and Retrieving RGB with SwiftData
I am out of ideas. I am trying to have a color theme picker in a view that would allow selection of predefined color theme values, store it in SwiftData as persistent storage and then use it throughout the app.
View not updating when relationship array changes
I’m working on a SwiftUI app using SwiftData for persistence. I have a TaskModel
class with a relationship to DailyProgress
objects. When I update the progress, the view doesn’t reflect the changes. Here’s an example to demonstrate: (You can just copy everything)
View not updating when relationship array changes
I’m working on a SwiftUI app using SwiftData for persistence. I have a TaskModel
class with a relationship to DailyProgress
objects. When I update the progress, the view doesn’t reflect the changes. Here’s an example to demonstrate: (You can just copy everything)
How to combine two Different models into Model container
I have two models that don’t have a relationship and I am attempting to combine them into a model container then insert some dummy data into one but I am getting a fatal error “failed to configure SwiftData container”:
How do you repopulate a SwiftData model if its not the one in modelContext
I have a Workout model that has a RelationShip with Exercise Model:
Managing Shared ModelContext for Adding Items in SwiftUI from Both ContentView and Background Tasks
I’m working on a SwiftUI project where I need to add Book objects to my model context from both the ContentView and a background task. I want to ensure that both operations use the same ModelContainer for consistency.
How do you let the user filter a SwiftData model using an @State Date
I can’t understand why app doesn’t have this in its docs but I am letting the user select a month and show in a list only the records that are from the month the user selected;
How do you use a SwiftData inverse relationship with a @Bindable
I have an inverse relationship between workout and Exercise like so: