美文网首页
iOS 阻止子视图响应父视图手势

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

作者: liang1030 | 来源:发表于2021-01-28 15:47 被阅读0次

实现手势以下代理方法:

#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

相关文章

网友评论

      本文标题:iOS 阻止子视图响应父视图手势

      本文链接:https://www.haomeiwen.com/subject/coxxtltx.html