Is it possible to disable the 'swipe-to-delete' gesture for a row/cell in a tableView? If so, how do you do it? The cell should still be editable in EDIT mode, but the swipe-to-delete gesture should be disabled.
Ios – Disable Swipe-to-Delete Gesture in UITableView
cocoa-touchiosobjective cuitableview
Related Topic
- Ios – How to make a UITextField move up when the keyboard is present – on starting to edit
- Ios – Eliminate extra separators below UITableView
- Ios – UITableView Cell selected Color
- Ios – UITableview: How to Disable Selection for Some Rows but Not Others
- Ios – UITableViewCell, show delete button on swipe
- Ios – How to disable back swipe gesture in UINavigationController on iOS 7
- Ios – Swipe to Delete and the “More” button (like in Mail app on iOS 7)
- Ios – Using Auto Layout in UITableView for dynamic cell layouts & variable row heights
Best Answer
Here's what to do:
You still need
tableView:commitEditingStyle:forRowAtIndexPath:
to animate the deletion.This is a much cleaner solution than iBrad Apps' solution, since you can use the default
self.editButtonItem
instead of a custom button.Link: UITableView disable swipe to delete, but still have delete in Edit mode?