user278859
user278859

Reputation: 10519

Can UILongPressGestureRecognizer be used together with touch events like touchesMoved?

If I add a UILongPressGestureRecognizer to an object is there a way to get a touchesMoved event in that object to fire after my longGesture selector responds to the longpress gesture without having to lift your finger first?

What I am seeing is that once the selector recognizes the long gesture the touchesMoved events will not respond until you remove your finger from the object. In other words you cannot Press, pause, move.

Is this even possible with a gesture recognizer or is the only way to do this is with a tap and hold approach.

I hope that makes sense.

Thanks.

Upvotes: 6

Views: 1514

Answers (2)

Elijah
Elijah

Reputation: 8610

    longPressGestureRecognizer.cancelsTouchesInView = false

Upvotes: 4

EmptyStack
EmptyStack

Reputation: 51374

Instead of relying on the touchesMoved method, you can add UIPanGestureRecognizer along with UILongPressGestureRecognizer to your view.

Upvotes: 6

Related Questions