I use pretty standard code to switch two UIImageViews that are inside a small view. (I am amazed that it worked!)
But what if I had THREE UIImageViews inside a small view ... and wanted to flip between all 3?
I thought I could just cut / paste 2 copies of my code ... but I think not.
When I try to flip 1> 2 .. and then 2> 3 ... it just flips once ... going directly from 1> 3. What happened to 2 ????
[UIView beginAnimations:nil context:NULL]
[UIView setAnimationDuration:0.5]
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:myView cache:YES]
[image1 removeFromSuperview]
[myView addSubview:image2]
[UIView commitAnimations]
[UIView beginAnimations:nil context:NULL]
[UIView setAnimationDuration:0.5]
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:myView cache:YES]
[image2 removeFromSuperview]
[myView addSubview:image3]
[UIView commitAnimations]
source
share