objective c - Adding new animation to the existing one -


In my application, I want to move UIImageView from the default position to the point where the user has been tapped. But if the user of this animation gets taped on the second point before completing the animation, then the image should not start with the original position, instead it should start from that point where the animation has stopped after tapping the new point. how can I do this. In the status of user tape, my code is low to move the image.

  - (zero) touches the brinze: (NSSET *) touches the event: (UIEvent *) event {UITouch * touch = [[Event All Tacches] any object]; Touch Point = [Touch Location Invoice: Touch. See]; [ImageViews.layer removeAllAnimations]; [UIImageView Animative Withdrawal: 2.0 Delay: 0 Option: UIViewAnimationOptionBeginFromCurrentState Animation: ^ {[Catering section start]; CAKeyframeAnimation * PathAnimation = [CAKeyframeAnimationwith the animation: @ "status"]; PathAnimation.duration = 2.0f; PathAnimation.calculationMode = kCAAnimationPaced; Animation path = [UIBezierPath bezierPath]; [AnimationPath Hilltouin: ImageViews Center]; [AnimationPathAdline TapePoint: CGPXMake (touched point.x, touched point.i)]; PathAnimation.path = Animation Path. CGPath; PathAnimation.fillMode = kCAFillModeForwards; PathAnimation.removedOncompletion = NO; [ImageViews.layer addAnimation: pathAnimation forKey: @ "animatePosition"]; [Catransens Cameat]; } Completion: zero]; // Once upon completion: ^ (BOOL) has ended {to end the animation of your code}]; }   

Instead, use it:

  [ UIImageView Animated Width: 2.0 Delay: 0 Option: UIViewAnimationOptionBeginFromCurrentState Animation: ^ {} Completeness: Zero];   

The UIViewAnimationOptionBeginFromCurrentState option will start the animation from the current state of the image. So if you are taking the image with another animation then all this will blend well.

Hope it helps.

Cheers!

Comments