Reputation: 552
Is there a faster method than looping through a uiview's subviews and testing cgrectcontainspoint?
Upvotes: 0
Views: 61
Reputation: 17898
I haven't tried it myself, but it looks like hitTest:withEvent: will do what you want.
The doc says that it traverses the view hierarchy calling pointInside:withEvent on each subview, which probably ends up calling CGRectContainsPoint, so it's probably no faster. I'd probably still try it rather than looping through the subviews manually.
Upvotes: 1