iOS - 模态视图跳转添加动画的两种方式

第一种

ModalViewController * modalView = [[ModalViewController alloc]init];

modalView.modalTransitionStyle = UIModalTransitionStyleCoverVertical;

[self presentViewController:modalView animated:YES completion:nil];
typedef NS_ENUM(NSInteger, UIModalTransitionStyle) {

    UIModalTransitionStyleCoverVertical = 0,//默认垂直向上

    UIModalTransitionStyleFlipHorizontal, 翻转效果

    UIModalTransitionStyleCrossDissolve,淡入淡出

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2

    UIModalTransitionStylePartialCurl,翻页效果

#endif
};

第二种

CATransition *animate =[CATransition getAnimation:1];

[[[[UIApplication sharedApplication] keyWindow] layer] addAnimation:animate forKey:nil];

[self presentViewController:rootVC animated:NO completion:^{
         
     }];

推荐阅读更多精彩内容