Ios – iPhone UIView touchesMoved: withEvent: does not get called on UIView with gesture recognizers

iosiphoneobjective cuiresponderuiview

I added a UIView that relied on TouchesMoved: events to drag touches. There's a long press, tap, rotate and pinch gesture recognizers already present within the same view controller. I'm running into an issue where the view receives touchesBegan: and touchesEnded: events, but no touches moved.

Is my issue with touchesMoved not being called being caused by gesture recognizers cancelling touches within the view? I also got a scroll view involved. Could that be the culprit?

If I will not be able to use touchesMoved, which is the closest gesture to implement the "touch and move" functionality. Is it tap or pan gesture recognizer?

Thank you for your help!

Best Answer

Gestures by default cancel the touches in the object they are linked to when they are active. You can stop this behavior by setting the cancelsTouchesInView property to NO.

Related Topic