让子视图不响应父视图的手势识别器

  -(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
    
    if ([touch.view isDescendantOfView:self.yourView]) {
        return NO;
    }
    return YES;
}

资料参考

你可能感兴趣的:(让子视图不响应父视图的手势识别器)