UIImageView startAnimating: How do you stop it on the last image in the series?

I use UIImageView to create a simple animation, and everything works fine, but when I use startAnimating, the animation will start once (as I want it), but return to the first frame. I want the animation to stop at the last frame.

I use:

myAnimation.animationImages = myArray;
myAnimation.animationDuration = 0.7;
myAnimation.animationRepeatCount = 1;
[myAnimation startAnimating];

Can I use override the startAnimating method? What is the best way to fix my problem?

+3
source share
2 answers

Before starting the animation, set the last image as an image imageView.image = yourLastImage;, and then start the animation. After the animation is completed, your LastImage will be displayed on the image.

NSTimer, , . , - , NSTimer, deanWombourne.

+8

- deleate, !

( , !)

1) ( )

2) NSTimer 'animationDuration'

3) , animationImages, animationImages nil.

EDIT: possilbe - , .

, - , , - , .

NB 100%, , . , : (

0

Source: https://habr.com/ru/post/1756906/


All Articles