How can I detect touch events on a UIImageView inside a deep hierarchy of UIViews?
- by jester
I am developing a simple game on iPhone and I started with a View based application, and through the UIViewController I am loading a custom UIView that contains some more UIViews and some UIImageViews. I want to detect touch events on some of the UIImageViews, but I wasn't able so far.
I've created a second project for testing purposes and figured that UIImageViews handle touch events when the hierarchy is like : UIViewController - UIView - UIImageView, but when it's like : UIViewController - UIView - UIView - UIImageView they are not detected.
Notes:
- userInteractionEnabled is YES in all cases
- all UIViews and UIImageViews I mention above are custom subclasses.
Can you think of any reason why, when a custom UIImageView gets deeper in the view hierarchy can't receive touch events?