Nate Pinchot Nate Pinchot - 1 year ago 111
iOS Question

Programmatically dismiss the "swipe to delete" button/state for UITableViewCell?

I'm working on an iPad app which has a

. The root view of the split view is a
. When the split view is rotated portrait, the root view controller is displayed in a
(obviously this is standard practice).

The issue I'm having is, when iPad is in portrait rotation, if the user swipes to delete on the root view and then touches on the detail view, and then opens the root view again, the cell will still be in the same state showing the "delete" from the swipe gesture. This is not the expected behavior.

Currently I am calling
on the table view in
(after super) in the root view, which has the desired end result. Is there is a more efficient way to accomplish this?

Answer Source

You could alternatively end the editing mode of the UITableView (probably also in viewDidDisappear).


Not sure if that's more efficient - more explicit perhaps.