Search code examples
iphonetouch-event

Can I cancel touch programmatically?


UIScrollView has a canceling mechanism, where it cancels the touch of subviews when it detects 'scrolling'.

I wonder if I can cancel a touch event (which already has begun) programmatically.

I have a draggable view inside a scroll view.
I can let the draggable view receive touches, but I'm wondering how to stop receiving touch events when I want and give touch events to the scroll view.


Solution

  • You might want to have a look at the UITapGestureRecogniser class's cancelsTouchesInView method