tags:

views:

695

answers:

1

I am trying to implement SMS kind of swipe and delete functionality.

In case of SMS application, an Edit button is on the left side of the navigation bar. When a swipe is attempted on a row, the Edit button changes to a Done button. If you click on Done button, the Delete mode is cancelled. If you click anywhere else on the tableview or scroll, the Delete mode is canceled again.

In my case, I am implementing willBeginRowEditing and didEndRowEditing as per the documentation to change view in case of swipe delete. I change Edit to Done in willBeginRowEditing and change it back in didEndRowEditing. Any scroll or any other touch automatically results in swipe delete cancellation.

But I do not seem to understand how to come out of the Delete mode when the user clicks on Done button. If I just change the editing mode for the tableView, didEndEditingRow is not called.

Is there any API to come out of swipe Delete mode?

Please let me know.

+1  A: 

Why do you want them to hit done when they use swipe delete method and want to cancel it?? If they are swipe deleting and want to undo it then they just swipe again...

Daniel
Yeah, another touch or a swipe results in the cancellation of the swipe gesture and that works fine.But I have a Done button sitting there on the navigation bar and in case of SMS app, if you press that, even then the swipe is cancelled.So I have to two options: either Make the Edit button disappear totally in swipe mode (or disable it) or if I change it do Done button, it should mimic the same cancel functionality as SMS app. But I do not seem to find any API to cancel a swipe gesture.
siasl