0
votes

I have a UIImageView that I would like to change its image with animation. I checked how to animate a UIImageView with an array but I don't wanna use many image.

I just wanna change the current image with a a new one using any kind of animation only once.

3
Thanks Control-V. I think that what I wanted actually. I confused animation with transitions. How could i make that an approved answer?Ali
Yah. I decided to not do any kind of transition. It is too much work for a simple thing.Ali

3 Answers

0
votes

I think you can find your answer on this

0
votes

The animationImages property works equally well with one image in it, or multiple.

0
votes

Just put the below code:

#import <QuartzCore/QuartzCore.h>
...
imageView.image = [UIImage imageNamed:"The image name"];

CATransition *transition = [CATransition animation];
transition.duration = 1.0f;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFade;

[imageView.layer addAnimation:transition forKey:nil];

I think you are searchig for this......