Created
November 3, 2009 18:13
-
-
Save Carigna/225301 to your computer and use it in GitHub Desktop.
Disable zoom on iphone webview
This file contains hidden or 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
| -(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { | |
| NSSet *touches = [event allTouches]; | |
| BOOL forwardToSuper = YES; | |
| for (UITouch *touch in touches) { | |
| if ([touch tapCount] >= 2) { | |
| // prevent this | |
| forwardToSuper = NO; | |
| } | |
| } | |
| if (forwardToSuper){ | |
| //return self.superview; | |
| return [super hitTest:point withEvent:event]; | |
| } | |
| else { | |
| // Return the superview as the hit and prevent | |
| // UIWebView receiving double or more taps | |
| return self.superview; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment