美文网首页
iOS 从不同方向presentViewController

iOS 从不同方向presentViewController

作者: JohnayXiao | 来源:发表于2020-06-12 10:26 被阅读0次

First ViewController

CATransition *transition = [CATransition animation];
transition.duration = 0.3;
transition.timingFunction = [CAMediaTimingFunction
    functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromRight;
[self.view.window.layer addAnimation:transition forKey:nil];
[self presentViewController:vc animated:NO completion:nil];

Second ViewController

CATransition *transition = [CATransition animation];
transition.duration = 0.3;
transition.timingFunction = [CAMediaTimingFunction
    functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromLeft;
[self.view.window.layer addAnimation:transition forKey:nil];
[self dismissViewControllerAnimated:NO completion:nil];

相关文章

网友评论

      本文标题:iOS 从不同方向presentViewController

      本文链接:https://www.haomeiwen.com/subject/zhhgtktx.html