手势&冲突

@protocol UIGestureRecognizerDelegate 

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

    // UITableView点击事件被手势截取
    if ([NSStringFromClass([touch.view class]) isEqualToString:@"UITableViewCellContentView"]) {
        
        return NO;
    //  手势&按钮的冲突
    }else if ([touch.view isKindOfClass:[UIButton class]]){
    
        return NO;
    }
    return  YES;
}

你可能感兴趣的:(手势&冲突)