alikaragoz/MCSwipeTableViewCell

Delegate method called two times

Closed this issue · 1 comments

Hi, I'm trying to use your MCSwipeTableViewCell in my project and came across this problem:
When detecting the end of the swipe for the mode 'EXIT', before deleting the row I need to ask the user if he's sure about it.
So in the delegate method swipeTableViewCell: didEndSwipingWithState I only present an AlertView to the user. To keep track of the swiped cell index, I'm using this code:

NSIndexPath *selectedIndexPath = [self.tableView indexPathForCell: cell];
NSLog(@"%d", selectedIndexPath.row);

Now when logging that value, during a cell swiping, I get two results, the first one is the correct one, the other is the next cell.

Could you help me please?

Thanks.

Hi @Aleph72 in the demo project I don't see the delegate being called 2 times. Can you please check you code again?

By the way I've pushed a commit that allow you to swipe the cell back to it's original position in case of confirmation for instance.

Thanks 👍