//翻转效果:
CATransition *animation = [CATransition animation];//准备动画
[animation setDuration:0.3f];动画播放持续时间
//动画速度,何时快、慢:
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]];
[animation setType:kCATransitionPush];//动画效果
[animation setSubtype:kCATransitionFromLeft];//动画方向
MyBabyViewController *myBabyViewController = [[MyBabyViewController alloc] initWithNibName:@"MyBabyViewController" bundle:nil];
[myBabyViewController.view.layer addAnimation:animation forKey:@"animationID"];
[self.view.window addSubview:myBabyViewController.view];
CATransition *animation = [CATransition animation];//准备动画
[animation setDuration:0.3f];动画播放持续时间
//动画速度,何时快、慢:
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]];
[animation setType:kCATransitionPush];//动画效果
[animation setSubtype:kCATransitionFromLeft];//动画方向
MyBabyViewController *myBabyViewController = [[MyBabyViewController alloc] initWithNibName:@"MyBabyViewController" bundle:nil];
[myBabyViewController.view.layer addAnimation:animation forKey:@"animationID"];
[self.view.window addSubview:myBabyViewController.view];