UITapGestureRecognizer breaks UITableView didSelectRowAtIndexPath

Ok, finally found it after some searching through gesture recognizer docs.

The solution was to implement UIGestureRecognizerDelegate and add the following:

#pragma mark UIGestureRecognizerDelegate methods
    
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{
  if ([touch.view isDescendantOfView:autocompleteTableView]) {
            
    // Don't let selections of auto-complete entries fire the 
    // gesture recognizer
    return NO;
  }
        
  return YES;
}

That took care of it. Hopefully this will help others as well.

Leave a Comment