I do not understand this.
My iPhone trainer did this for me a while ago. But I did not look at what he did.
So here is the code. .h
.m
#import "flipTesViewController.h" @implementation flipTesViewController -(IBAction)test{ [UIView beginAnimations:nil context:nil]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:containerView cache:YES]; [UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector:@selector(test)]; [UIView setAnimationDuration:.5]; if(heads.tag==1){ [containerView addSubview:heads]; heads.tag=2; } else{ [containerView addSubview:tails]; heads.tag=1; } [UIView commitAnimations]; } - (void)viewDidLoad { [super viewDidLoad]; heads = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"NZHeads.png"]]; tails = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"NZTails.png"]]; [containerView addSubview:heads]; } //other method built in to view based template @end
source share