I am using UIImageView to create a simple animation and everything works perfectly, but when I use startAnimating, the animation will run once (as I want it to) but go back to the first frame. I want the animation to stop on the last frame.
I use:
myAnimation.animationImages = myArray;
myAnimation.animationDuration = 0.7;
myAnimation.animationRepeatCount = 1;
[myAnimation startAnimating];
Could I have to use override the startAnimating method? What is the best way to fix my problem?
Before you start animating, set the last image in the image view imageView.image = yourLastImage; and then start the animation. After the animation is complete the image view will show yourLastImage.
As for the NSTimer thing, theres no other alternative to know when the default animation has ended. So if you want to do anything after the animation completes, you have to rely on NSTimer as deanWombourne suggested.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With