In UITableView, you can tap and hold on a table cell and cancels the tap and continue on with scrolling if you move your finger. How can this done with UIScrollView with a subview? I am able to make it so you can scroll and you can tap on the subview, but am having issue with the latter behavior – make scrollview continue to scroll if you move your finger while tapping and holding.
Share
I assume you are using a
UITapGestureRecognizeron the subview. The scroll view uses aUIPanGestureRecognizerfor scrolling. You simply need to tell the tap recognizer not to recognize unless the pan recognizer fails.If you are targetting iOS 5, this is very easy:
If you are targetting an older version of iOS, older versions of
UIScrollViewdon’t have thepanGestureRecognizerproperty. Instead you have to search through the scroll view’sgestureRecognizersarray: