I have implemented my own custom subclass of UIView
and overridden the drawRect:
method.
In my custom view I also want the handle touches, so I also overridden touchesBegan
, touchesMoved
and touchesEnded
.
This works fine but if the number of views on the screen increases then I have to use a UIScrollView
as the root view of my UIViewController
.
Once my custom UIView
becomes the subview of UIScrollView
, then it does not receive the touch events. Even though I move my finger within my custom UIView
, the scroll view gets scrolled (all my touch events go to the UIScrollView
).
How do I solve this problem?