views:

34

answers:

0

I know UIView's hitTest:withEvent: method digs down to the far-most view that gets the touch event, but how would you get the opposite result? The first view to get an event at a certain CGPoint?

EDIT As zem pointed out, that hitTest method returns the farthest descendent in the view hierarchy. In my case, I have a mapView with a bunch of pinViews on it and I wanna get the frontmost pin at a certain CGPoint. That hitTest method keeps returning MKAnnotationContainerView, which I assume is a UIView that contains all my pinViews. How do I make it return the pinView itself and not its furthest descendant?