Skip to content

Instantly share code, notes, and snippets.

@tad-iizuka
Created September 22, 2016 12:03
Show Gist options
  • Save tad-iizuka/fc5af32806009311a7eb4cceb5f13645 to your computer and use it in GitHub Desktop.
Save tad-iizuka/fc5af32806009311a7eb4cceb5f13645 to your computer and use it in GitHub Desktop.
let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext
for obj in self.item {
context.delete(obj)
}
do {
try context.save()
} catch {
print(String(format: "Error %@: %d",#file, #line))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment