Post

Replies

Boosts

Views

Activity

Comment on SwiftData - Context missing for optional
I have a workaround. What I had to do was avoid using the values directly from the model. Instead, I created more generic components and moved the deletion fn outside of the component. Before: MyItem(item: ItemModel) (The model is passed directly, all the logic is handled inside the MyItem component) After: MyItem(name: item.name, description: item.description, onDelete: someFunction()) (Only specific values are passed, the deletion logic is handled externally) I haven't had any crashes so far.
Sep ’24