Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIEvent passed into -[UIView hitTest:]

Tags:

cocoa-touch

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.

like image 381
Ryan Brubaker Avatar asked Nov 05 '22 22:11

Ryan Brubaker


1 Answers

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

like image 170
Ryan Brubaker Avatar answered Nov 25 '22 03:11

Ryan Brubaker