withAnimation(.easeInOut){
delete(deck)
}
func delete(deck){
container.viewContext.delete(deck)
do{
try container.viewContext.save()
} catch let error {
print("Delete Failed
}
}
This (pseudo) code almost always throws a CoreData concurrency violation when running on device from Xcode. It doesn't seem to happen when running the app directly on device (without Xcode)
Wrapping the delete with a viewContext.perform block stops the crash but the delete no longer animates in the VGrid
Appreciate any help