Having trouble capturing touch events in UIWebView. Want to be able to sense touches on words on scrolling HTML page for the purpose of inserting hyperlinks into the HTML [which I fully control] at the point of touch. Obviously some existing agent is already sensing touches, because I get a "Copy or Define" popup with magnifying glass.
I've been able to capture touch events in a different custom UIViewController in my app that has no UIWebView, placing:
self.view.userInteractionEnabled = YES;
self.view.multipleTouchEnabled = YES;
in viewDidLoad and placing
- (BOOL) canBecomeFirstResponder
{
NSLog(@"canBecomeFirstResponder");
return YES;
}
in the implementation. Then "touchesBegan" is called whenever I touch anywhere on the view controller.
But the same code isn't effective on the custom view controller where most of the screen is covered by a UIWebView. Curiously, touches in the small UIToolBar at the bottom does indeed call "touches Began" but something in the UIWebView is pre-empting my "touchesBegan".
Is there a way to capture these events without disabling everything UIWebView wants to do? I wouldn't want to lose scrolling and other features.
Thanks. And Happy New Year.