- (void)viewDidLoad {
[super viewDidLoad];
_ImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width, [[UIScreen mainScreen] bounds].size.height)];
_ImageView.image = [UIImage imageNamed:@"1"];
[self.view addSubview:_ImageView];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
_index++;
if (_index == 4) {
_index = 1;
}
NSString *fileName = [NSString stringWithFormat:@"%d",_index];
_ImageView.image = [UIImage imageNamed:fileName];
CATransition *anim = [CATransition animation];
anim.type = @"pageCurl";
anim.subtype = kCATransitionFromRight;
anim.duration = 1;
[_ImageView.layer addAnimation:anim forKey:nil];
}
[super viewDidLoad];
_ImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width, [[UIScreen mainScreen] bounds].size.height)];
_ImageView.image = [UIImage imageNamed:@"1"];
[self.view addSubview:_ImageView];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
_index++;
if (_index == 4) {
_index = 1;
}
NSString *fileName = [NSString stringWithFormat:@"%d",_index];
_ImageView.image = [UIImage imageNamed:fileName];
CATransition *anim = [CATransition animation];
anim.type = @"pageCurl";
anim.subtype = kCATransitionFromRight;
anim.duration = 1;
[_ImageView.layer addAnimation:anim forKey:nil];
}