iOS 阻止子视图响应父视图手势

2021-01-28  本文已影响0人  liang1030

实现手势以下代理方法:

#pragma mark --UIGestureRecognizerDelegate

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

参考:https://www.jianshu.com/p/6a31fafa1ca3

上一篇下一篇

猜你喜欢

热点阅读