I was wondering how to pass touch events to UIWebview and here it is
UIWebview does not handle the touch event, instead it is some other view (i.e UIWebDocumentView) which handles the events. But, many people wonder, including me, how this undocumented, private object come into picture.
And the answer is UIWebview seems to override the hitTest:withEvent: method which on invoked returns the UIWebDocumentView, which means that all the subsequent touch events will be routed to UIWebDocumentView
Now how do we by pass this situation, so that one of our view class should get control over the touch event?
This can be done by subclassing the UIWebview and overriding the hitTest:withEvent method and invoking super class method
_responderView = [super hitTest:point withEvent:event];//capture the view which actually responds to the touch events
return self;//pass self so that the touchesBegan,touchesMoved and other events will be routed to this class itself
//override touch events
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
[ _responderView touchesBegan:touches withEvent:event];