I have a UIView on which I have added PanGestureRecognizer, My UI will behave like panning and after end of pan gesture it should continue to move on that direction with some deceleration. Which I have done. I show deceleration by a block
[UIView animateWithDuration:slideFactor*2
delay:0
options:UIViewAnimationOptionCurveEaseOut | UIViewAnimationOptionAllowUserInteraction
animations:^{
_movieView.center = finalPoint;
} completion:nil];
Now during animation if it recognizes another touch or tap or pan, It should stop at that point. So, that further panning can be done.
My selector method for PanGestureRecognizer is doing something like this.
if ([panGesture state] == UIGestureRecognizerStateChanged)
{
[self mpvGestureStateBeginOrChanged:panGesture];
}
if ([panGesture state] == UIGestureRecognizerStateEnded)
{
[self mpvGestureStateEnd:panGesture];
}
if ([panGesture state] == UIGestureRecognizerStateBegan)
{
[self.view.layer removeAllAnimations];
// It stops at the final end position of the view
// I want to stop animation right at the this point.
}
Note Due to some restrictions of UI, I can't use UIScrollView. Kindly suggest me something or solve the problem