超出父视图部分响应事件

 1 - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
 2     UIView *view = [super hitTest:point withEvent:event];
 3     if (view == nil) {
 4         
 5         for (UIView *subView in self.subviews) {
 6             CGPoint position = [self convertPoint:point toView:subView];
 7             if (CGRectContainsPoint(subView.bounds, position)) {
 8                 view = subView;
 9                 break;
10             }
11         }
12         
13     }
14     return view;
15 }
原文地址:https://www.cnblogs.com/buakaw/p/6434330.html