Hey there,
for my recent projects I used CoreData for persistence. One nice feature I use all the time is the ability to create a child context for editing operations.
When editing an entity in a form presented as a sheet, the changes made are only saved into the main context/parent context if the child context (I call this the editing context) is saved. Therefore dismissing an editing view results in destroying the child context and all the changes are discarded. Likewise when saving in the editing view, the changes will be proceeded to the parent context and persisted.
Is there any possibility to get the same or equivalent behavior when using SwiftData. Or is there another way to model this kind of cases?
All the best from Cologne, Germany!