I want to grease the animation of the image in UIImageView in order to turn into the next one in one second, as UIModalTransitionStyleCrossDissolve does.
Currently I have a UIImageView * called "imageView" and a function called "imageForState" that returns me UIImage * for the correct image.
So what I want to do is to animate the image smoothly into image B, if there is one.
Currently my function is this:
- (UIImage *) imageForState{ NSLog(@"state: %d", [save state]); switch ([save state]) { case 0: case 1: return [UIImage imageNamed:@"Sakuya_Debug.PNG"]; case 2: return [UIImage imageNamed:@"Sakuya_2_Debug.PNG"]; default: return NULL;
My problem is that 1.) the animation continues forever (when I set imageView.animationRepeatCount to 1, I find myself in the first image again) and b.) The animation is not smooth; just as I would use "setImage";
What am I doing wrong?
source share