Skip to content

Instantly share code, notes, and snippets.

@ecerney
Created January 19, 2015 07:36
Show Gist options
  • Save ecerney/b930f9cc6dd102bca632 to your computer and use it in GitHub Desktop.
Save ecerney/b930f9cc6dd102bca632 to your computer and use it in GitHub Desktop.
override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
tableView.beginUpdates()
if editingStyle == .Delete {
println(self.savedJobs)
println("\(indexPath.row) row will be deleted")
let deletedJob = self.savedJobs.removeAtIndex(indexPath.row)
deleteJobFromCoreData(deletedJob)
tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Top)
}
tableView.endUpdates()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment