Kex Kex - 6 months ago 26
iOS Question

Is there anyway to simulate a cell swipe so the cell swipes when the cell is tapped?

I have been trying to find a solution for this, was wondering if there is anyway to simulate a cell swipe so when you tap the cell it will swipe to show its options (i.e. the delete one). I am actually using MSSwipeTable cell (https://github.com/MortimerGoro/MGSwipeTableCell) and I like the animation effects, but I want this to work for tapping a cell not swiping. Any ideas?

Thanks

Answer

There is a method for that in MGSwipeTableCell : -(void) showSwipe: (MGSwipeDirection) direction animated: (BOOL) animated;

You just have to call it in your - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath method.

https://github.com/MortimerGoro/MGSwipeTableCell/blob/master/MGSwipeTableCell/MGSwipeTableCell.h#L153

Comments