Is there any way to programmatically trigger the equivalent of swiping left on a UITableViewCell that has edit actions? This is different from simply [tableView setEditing:YES animated:YES]
as that method sets the entire table into editing mode and shows the insert/delete left accessory view and/or reorder controls rather than the edit actions for a single row.
Asked
Active
Viewed 1,711 times
9

Ken M. Haggerty
- 24,902
- 5
- 28
- 37
-
3Were you able to figure out how to do this ? – GoodSp33d Aug 02 '16 at 08:42
1 Answers
-2
You can use optional func tableView(_ tableView: UITableView, editingStyleForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCellEditingStyle
from UITableViewDelegate. And return UITableViewCellEditingStyleDelete
for the cell you want to swipe. Use func reloadRowsAtIndexPaths(_ indexPaths: [NSIndexPath], withRowAnimation animation: UITableViewRowAnimation)
to reload that cell when you want to trigger the swipe.

Jelly
- 4,522
- 6
- 26
- 42