Allin1969 Allin1969 - 1 month ago 10x
Objective-C Question

UIImageview rotation animation

I want to apply an animation to two

. The idea is for image one to flip horizontally by 90 degrees and then image two to complete the rotation. Think of it as a coin spinning: Head side (image one) faces forward -> turn 90 degrees -> Tail side (image two) rotates to face forward. I can do the first half of the animation but I am stuck on the second.

[UIView animateWithDuration:1.0f animations:^{
image1.transform = CGAffineTransformMakeScale(-0.01, 1);
} completion: ^(BOOL finished) {
// How can I make image 2 to rotate out as if it initially was already rotated by 90 degrees?


for flipping animation, there a animation option called UIViewAnimationOptionTransitionFlipFromRight, use it with the UIView's animation method for example, like below for example

 [UIView transitionWithView:myImageView //with first image
                  duration:self.hotspot.imageInterval + self.hotspot.animationDuration
                    myImageView.image = toImage; //to next image
                } completion:^(BOOL finished)
             //completion actions after flipped


there are other animation options also there, like FromLeft, FromTop,FromBottom use any one to your requirement