You can use this robust approach, or this smart method. But the first is using the UNDOCUMENTED (private) API, and the second is not working for me (and for somebody according to the comments on that blog post). So this is my solution.
Subclass UIWebView and put these lines under your implementation:
- (UIView *)hitTest:(CGPoint)point
withEvent:(UIEvent *)event
{
CGPoint p = currentPoint;
NSTimeInterval t = currentTimestamp;
currentPoint = point;
currentTimestamp = [event timestamp];
if (CGPointEqualToPoint(p, point) &&
[event timestamp] - t < 0.2){
NSLog(@"double taps");
return self.superview;
}
return [super hitTest:point withEvent:event];
}
Notice: declare ivar currentPoint and currentPoint in your header file.
It works like a charm.