iOS 只让子控件响应手势,父视图,父父视图不响应
2020-05-19 本文已影响0人
不会拉磨的驴
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
if ([gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]]) {
if ( [touch.view isDescendantOfView:_errorView] ) {
return NO;
}
}
return YES;
}