Skip to content

Instantly share code, notes, and snippets.

@flexaddicted
Created February 20, 2015 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flexaddicted/fdeb6191da3e3c412d25 to your computer and use it in GitHub Desktop.
Save flexaddicted/fdeb6191da3e3c412d25 to your computer and use it in GitHub Desktop.
func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
return true
}
func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
if(editingStyle == UITableViewCellEditingStyle.Delete) {
// Here you should commit your editing
}
}
func tableView(tableView: UITableView, editingStyleForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCellEditingStyle {
return UITableViewCellEditingStyle.Delete
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment