Skip to content

Instantly share code, notes, and snippets.

@dimitris-c
Created September 11, 2014 15:34
Show Gist options
  • Save dimitris-c/17b35c3bbb4cebd3e3df to your computer and use it in GitHub Desktop.
Save dimitris-c/17b35c3bbb4cebd3e3df to your computer and use it in GitHub Desktop.
Disable touches behind a UIVIew
@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