What Im looking for is to be able to intercept touches on a UIWebView (specifically a single tap to bring up a toolbar). UIWebView eats all touches, so I have a transparent view over a UIWebView. The transparent view (which is a subclass of UIView) is getting the events and the UIWebView is displaying fine behind the transparent view. What I cant get working is the forwarding of events to the UIWebView so the user can still interact with the UIWebView
Heres the code:
All the touch events in the TransparentView look like:
My output looks like:
touch = <uitouch: 0x108ea30> phase: Began tap count: 1 window: <uiwindow: 0x1027300> view: <transparentview: 0x1084610> location in window: {32.000000, 164.953613} previous location in window: {32.000000, 164.953613}
So perhaps the touch won't work with the UIWebView because touchesForView returns "transparentView"? If so, how to I get past this?
Any ideas? I think Im really close
thanks
Heres the code:
All the touch events in the TransparentView look like:
Code:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[webView touchesBegan:touches withEvent:event];
UITouch* touch = [[event touchesForView:self] anyObject];
NSLog(@"touch = %@", touch);
}
My output looks like:
touch = <uitouch: 0x108ea30> phase: Began tap count: 1 window: <uiwindow: 0x1027300> view: <transparentview: 0x1084610> location in window: {32.000000, 164.953613} previous location in window: {32.000000, 164.953613}
So perhaps the touch won't work with the UIWebView because touchesForView returns "transparentView"? If so, how to I get past this?
Any ideas? I think Im really close
thanks