Fatal error: Duplicate keys of type ‘AnyHashable’ were found in a Dictionary
I get the following fatal error when the user clicks Save
in AddProductionView.
Model class’s members are not being set by Form fields
I have the following SwiftData model:
SwiftData Model Not Saving Changes
In the following example, changes to my UserGroup
aren’t saved and don’t update the UI.
SwiftData Model Not Saving Changes
In the following example, changes to my UserGroup
aren’t saved and don’t update the UI.
Extracting a view into a subview breaks onDelete of ForEach in SwiftUI
I have a SwiftData model Exercise which has an array of MySet, every MySet has an Exercise as a Parent
SwiftData @Observable vs Observable protocol
In SwiftData, what’s the difference between @Observable
and conforming to Observable
? Are they functionally equivalent?
How do you animate a new item being added to the list if your list is built from a SwiftData Query
Say you have a query of a SwiftData object and you populate a ForEach using it:
How to clear a TextField when it bound to a SwiftData object that isn’t optional
Say you have a SwiftData object that doesn’t allow optionals:
TextField wont allow Nil for objects that already exist but will for new objects
I have a SwiftData object Set that has a non Optional reps and Weight and when my editView gets initialized I Set the existing sets to a State object:
How can I observe changes to a model in SwiftUI using a ViewModel with SwiftData?
I am working on a SwiftUI macOS application. My goal is to observe changes in my model using a ViewModel to update the UI accordingly. However, my MenuView does not observe changes when I add a new data to SwiftData.