iphone - UIImageView startAnimating: How do you get it to stop on the last image in the series? -
I am using UIImageView to create a simple animation and everything works perfectly, but when I start I will run the animation once (as I want), but back to the first frame I want to stop the animation on the last frame.
I use:
myAnimation.animationImages = myArray; MyAnimation.animationDuration = 0.7; MyAnimation.animationRepeatCount = 1; [MyAnimation startAnimating];
Could I use startAnimating method override? What is the best way to fix my problem?
Before starting animating, set the last image image view imageView.image = yourLastImage ;
and then start the animation After the animation is complete, the image view will show your last image.
For NSTimer thing, there is no other option to know when the default animation is over. So if you want to do anything after the animation is completed, then you have to rely on NSTimer as Dean Vomboron has suggested.