4

I try to make row action for UITableViewCell and I have a problem with highlight while swipe. The user doesn't really select the cell, he simply swipe to left.

My shouldHighlightRowAtIndexPath looks like this:

    - (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath {

       // Sets the inner rectangle to the selected color
        [cell setCellColorWithString:COLORS_ARRAY[4]];
        
        return YES;
    }

And my editActionsForRowAtIndexPath cancel the highlight if this is the right thing to do, but it called too late :/

Can I get any event when the user start/stop swipe to left/right?

Any help will be great. Thanks in advance.

enter image description here

Community
  • 1
  • 1
gran33
  • 11,548
  • 8
  • 43
  • 74

1 Answers1

0

You could add a swipe gesture recogniser to the table view, find the cell that matches the touch point of the swipe and then unhighlight it.

See this answer

Community
  • 1
  • 1
John Martin
  • 1,492
  • 1
  • 13
  • 25