tags:

views:

2645

answers:

2

I'm overriding the -hitTest: method in a custom UIWebView subclass. The UIEvent that gets passed to this method always has an empty set of touches ( [[event allTouches] count] is == 0 ). Shouldn't there be touch information in the UIEvent object or is this a bug?

I've tried other UIVIew types (e.g. UIView, UIWindow) and see the same behavior so it's not restricted to UIWebView. This is for any version of the 2.* SDK.

Thanks.

A: 

Looks like you have to implement a transparent view on top of it, and then delegate all events down to the UIWebView:

has a bunch more information about how they got it to work.

Cory Foy
Thanks for the response Cory. I haven't had much luck with that approach although I will go back over that thread to see if I missed something.Still wondering why the UIEvent passed into the hitTest method has an empty set of touches...
Ryan Brubaker
+2  A: 

I was never able to figure out why the UIEvent passed into hitTest:withEvent had an empty set of touches.

I did come up with a solution to my problem though. I was only concerned with single-taps so I'm not sure how applicable it might be to anyone else's situation. See my blog post at: http://ryan-brubaker.blogspot.com/2009/01/iphone-sdk-uiwebview.html

Ryan Brubaker