Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
UIView that does not recognize any touch on itself. Only touches on subviews are detected.
#import <Foundation/Foundation.h>
@interface UntouchableUIViewContainer : UIView
@end
#import "UntouchableUIViewContainer.h"
@implementation UntouchableUIViewContainer
-(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
UIView* view = [super hitTest:point withEvent:event];
if(view == self)
{
view = nil;
}
return view;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.