Search code examples
iphoneuiviewcontrolleruiscrollviewuitouch

Touch events not working on UIViews inside UIScrollView


I have a series of UIViews inside a UIScrollView, and the UIViewControllers for those views are not receiving the touch events. If I take the views out of the scroll view then it works.

I have enabled userInteraction on the views but it's still not working!

This must be possible and I'd be really grateful if someone could point me in the right direction!

Thanks,

Mike


Solution

  • I have overcome this issue by overriding the loadView method of the view controller, and setting the view's instance variable to a simple UIView subclass which passes on the touches.