This is built into the UIScrollView
- take a look at the delaysContentTouches
and canCancelContentTouches
. This should alleviate the problem of dragging a small bit after clicking.
This is all system built-in behavior. I would advise you to stick with what Apple has provided for the perception of your interface (for example, how it reacts to small drags), so that your application does not feel out of place on a user phone.
EDIT:
Alternatively, you can disable the scrolling of your scroll in your gesture recognizer and enable it again after it is completed / canceled.
Further editing: I don’t understand - I created a sample project that illustrates how to intercept touches in the scroll pod using the gesture recognizer delegation methods. Pay close attention to the “Cancel access to content” and “Hold content bindings” properties in the scroll view. They are both YES
for very important reasons.
Scrolling in the view should delay the content until it determines whether the user is trying to press the red button, the pseudo-drive (as you put it), or the panorama to view the scroll. Apple has already written the functionality you are trying to build; UIScrollView
will already do what you want.
The problem is that the system does not want the scroll view routines to catch short press events when the scroll is viewed. To this end, it cancels touch events if it determines that the user is actually trying to pan. The setting "Delays when submitting content" allows this behavior. Make sure it is turned on and everything will be in order.
source share