I have a TableView which is already coded to perform an action when any cell it selected using the didSelectRowAt
method.
Now, I'd like to add a Swipe Left gesture to the Table (or cell) so that I can perform a secondary action when a cell is swiped rather than when tapped.
1) I would like the cell to move left while swiping but I do NOT want to add a button in the space where the cell has moved from.
2) Instead, I'd like to be able to 'drag' the cell left until a certain point (say halfway) and at that point execute the secondary action with the indexPath (so I know which cell was dragged).
3) If the user stops dragging or lets go of the cell, I'd like it to return to it's starting position and have no actions occur.
I've seen a lot of samples that do various pieces of this but most are in Obj-C or insert buttons in the same row as the cell.
Also, is it better to add the Gesture to each cell? It seems smarter to add it to the table...
EDIT: See below for my complete answer with code