Last active
March 8, 2019 10:25
-
-
Save Andrewmika/54d937cfc13e2cd196fde73942e9837c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { | |
if (self.clipsToBounds || self.hidden || (self.alpha == 0.f)) { | |
return nil; | |
} | |
UIView *view = [super hitTest:point withEvent:event]; | |
if (view) { | |
return view; | |
} | |
for (UIView *subView in self.subviews.reverseObjectEnumerator) { | |
CGPoint subPoint = [subView convertPoint:point fromView:self]; | |
view = [subView hitTest:subPoint withEvent:event]; | |
if (view) { | |
return view; | |
} | |
} | |
return nil; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment