The only thing you need to delete a CoreData object is the viewContext
and the object itself. With those values you can execute the following:
viewContext.delete(yourObject)
do {
try viewContext.save()
} catch {
// handle your error here
}
💻Software engineer
🇪🇸From Madrid, Spain
💼Building a one-person business
🧱LEGO collector
Back
The only thing you need to delete a CoreData object is the viewContext
and the object itself. With those values you can execute the following:
viewContext.delete(yourObject)
do {
try viewContext.save()
} catch {
// handle your error here
}