Created
September 11, 2014 15:34
-
-
Save dimitris-c/17b35c3bbb4cebd3e3df to your computer and use it in GitHub Desktop.
Disable touches behind a UIVIew
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
@interface PassthroughView : UIView | |
@end | |
@implementation PassthroughView | |
-(BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event { | |
for (UIView *view in self.subviews) { | |
if (!view.hidden && view.alpha > 0 && view.userInteractionEnabled && [view pointInside:[self convertPoint:point toView:view] withEvent:event]) | |
return YES; | |
} | |
return NO; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment