CATransition转场动画 可以切换视图 视图控制器
type 转场动画的动画效果
subtype 转场动画 效果的方向
kCATransitionFade 交叉淡化过渡
kCATransitionMoveIn 新视图移到旧视图上面
kCATransitionPush 新视图把旧视图推出去
kCATransitionReveal 将旧视图移开,显示下面的新视图
私有api 不建议使用 苹果不提供维护 并且有可能app审核不通过
pageCurl 向上翻一页
pageUnCurl 向下翻一页
rippleEffect 滴水效果
suckEffect 收缩效果 如一块布被抽走
cube 立方体效果
oglFlip 上下翻转效果
#pragma mark------切换视图控制器——----
- (void)next:(UILongPressGestureRecognizer *)sender
{
if (sender.state == UIGestureRecognizerStateBegan) {
NextViewController *nextVC = [[NextViewController alloc]init];
CATransition *animation = [CATransition animation];
animation.type = @"oglFlip";
animation.subtype = kCATransitionFromBottom;
animation.duration = 1.0;
[self.navigationController.view.layer addAnimation:animation forKey:nil];
// 如果使用 自定义的转场动画 必须禁用系自带的动画
[self.navigationController pushViewController:nextVC animated:NO];
}
}