iOS 只让子控件响应手势,父视图,父父视图不响应

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
    if ([gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]]) {
        if ( [touch.view isDescendantOfView:_errorView] ) {
            return NO;
        }
     }
            return YES;
    }

你可能感兴趣的:(iOS 只让子控件响应手势,父视图,父父视图不响应)