Ok, I have the following code working:
Code:
-(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
NSSet *touches = [event allTouches];
BOOL forwardToSuper = YES;
NSLog(@"hit");
NSLog(@"Touches count: %d", [touches count]);
for (UITouch *touch in touches) {
if ([touch tapCount] == 1) {
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;
}
}
But for some reason, it doesn't detect taps, the touches count is zero. Does anyone knows how to detect taps or how to know if the webview is scrolling?