Changing the velocity of a UIPanGestureRecognizer?

I have a table view within a scroll view. The inner table view displays content, and the outer scroll view provides zooming for the table view's content. When the outer scroll view gets a pan gesture, I want it to scroll both views in response to a pan gesture, so I overrode -gesture:shouldRecognizeSimultaneouslyWithGestureRecognizer: to trigger both pan gesture recognizers at once, but now pans are moving twice as fast.


How do I change the velocity so they are at half their current velocity? Right now, panning is happening twice as fast as it should be happening, and I'd like to fix that. I tried adjusting the translation using -setTranslation:inView:, which says it adjusts the velocity in the documentation, but it doesn't seem to actually do anything to the velocity...

You should probably use

func velocity(in view: UIView?) -> CGPoint


https://stackoverflow.com/questions/26748219/access-the-velocity-of-a-pan-gesture

Thanks, but that just accesses the velocity. My question is, how do I change the velocity?

Yes, I know.


So read the post.

They propose to compute how much move of gesture, then recompute the new position (in your case divide move distance by 2).

That will mimic a change in velocity (as you cannot change it directly).


More than a velocity, it is sensitivity that you need to change.

Changing the velocity of a UIPanGestureRecognizer?
 
 
Q