How to Cancel Scrolling in UIScrollView
If you want to detect touches inside any of the subviews of the UIScrollView, you will have to subclass UIScrollView and override the touchesShouldBegin
and touchesShouldCancelInContentView
methods which are specifically created for this purpose.
Other than this, there is no way you can identify touches in the subviews as UIScrollView tends to handle all touches itself and doesn't pass them to its subviews.
All the best.
UIScrollView has a scrollEnabled property that allows you to disable scrolling programatically. It also has a delegate (UIScrollViewDelegate) that allows you to see events such as scrolling starting/ending. Seems that you should be able to cook something up with those options combined in some way.
The property you're really interested in -- and I'm actually testing this out right now, because I have the same problem you do -- is canCancelContentTouches
.
If the value of this property is NO, the scroll view does not scroll regardless of finger movement once the content view starts tracking.
If this doesn't give you the results you want, subclass UIScrollView and override the touchesShouldBegin:withEvent:inContentView
method, which is what the accepted answer suggests.