如何屏蔽父view的touch事件到,并且响应self的touch

- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
 CGMutablePathRef path = CGPathCreateMutable();
 CGPathMoveToPoint(path,NULL,0,0);
 CGRect rect = CGRectMake(0, 100, 320, 40);
 CGPathAddRect(path, NULL, rect);
 
 if(CGPathContainsPoint(path, NULL, point, NO))
 { 
       [self.superview touchesBegan:nil withEvent:nil];
 } 
 CGPathRelease(path);
 return self;
}

你可能感兴趣的:(null,Path,UIView)