Last active
March 19, 2020 18:12
-
-
Save StephanPartzsch/5627928 to your computer and use it in GitHub Desktop.
[UntouchableUIViewContainer] UIView that does not recognize any touch on itself. Only touches on subviews are detected. (#UI)
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 <Foundation/Foundation.h> | |
@interface UntouchableUIViewContainer : UIView | |
@end |
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 "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