Я не понимаю этого атма.
Мой тренер по iPhone сделал это для меня некоторое время назад ... но я не смотрел на то, что он сделал.
Так вот код.
.h
#import <UIKit/UIKit.h>
@interface flipTesViewController : UIViewController {
IBOutlet UIView *containerView;
UIImageView *heads;
UIImageView *tails;
}
-(IBAction)test;
@end
.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