tap手势区分

  1. 当同一页面同时添加UITapGestureRecognizer 手势与 UITableView 时,为区分手势,可利用UIGestureRecognizerDelegate
    中的协议方法进行处理:

#pragma mark - gestureRecognizer

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch

{

if ([NSStringFromClass([touch.view class]) isEqualToString:@"UITableViewCellContentView"]) {

return NO;

}

return YES;

}

你可能感兴趣的:(tap手势区分)