0
votes

I am working with UITapGestureRecognizer for doubleTap on a UITableViewCell.

So I added the gesture in this way in CellForRowAtIndexPath.

  UITapGestureRecognizer *m_doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doubleTap:)];
    m_doubleTap.numberOfTapsRequired = 2;


    [tableCell addGestureRecognizer:rightSwipeGestureRecogniser];
    [tableCell addGestureRecognizer:m_doubleTap];

But

- (void)doubleTap:(UITapGestureRecognizer *)gestureRecogniser
{
}

is not getting Instead this is called

  • (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { }

So i tried this..

 m_doubleTap.cancelsTouchesInView = YES;
   m_doubleTap.delaysTouchesBegan = YES;

Now it works and but didSelectRowAtIndexPath functions gets very slow.

So How to solve this problem.

1

1 Answers

1
votes

Try setting

[cell setUserInteractionEnabled:YES];

Hope this solves your problem.

or try implementing the following method and return nil

- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath