參考
http://www.reibang.com/p/5e86f900b3cc
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event;
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
UIView *view = [super hitTest:point withEvent:event];
CGPoint tempPoint = [self.editBtn convertPoint:point fromView:self];
if([self.editBtn pointInside:tempPoint withEvent:event])
{
return self.editBtn;
}
return view;
}
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event;
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event {
return ([super pointInside:point withEvent:event]
|| CGRectContainsPoint(_tipView.frame, point)
);
}