Created
February 1, 2015 15:10
-
-
Save xissburg/a655b0aeb5497b1698af 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
#import "UntouchableView.h" | |
@implementation UntouchableView | |
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event | |
{ | |
if (!CGRectContainsPoint(self.bounds, point)) { | |
return NO; | |
} | |
for (UIView *subview in self.subviews) { | |
if (subview.isUserInteractionEnabled && [subview pointInside:[self convertPoint:point toView:subview] withEvent:event]) { | |
return YES; | |
} | |
} | |
if (self.didTouch) { | |
self.didTouch(point, event); | |
} | |
return NO; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment