How to know pan gesture change direction in ios?
<pre><code>- (void)panRecognized:(UIPanGestureRecognizer *)rec
{
    CGPoint vel = [rec velocityInView:self.view];
    if (vel.x &gt; 0)
    {
        // user dragged towards the right
        counter++;
    }
    else
    {
        // user dragged towards the left
        counter--;
    }
}
</code></pre>

<p>When I pan gesture move to left ,then move to right. it will use right .
I want to How to know pan gesture change direction?</p>