ios ViewController present不同的方向

Posted 我叫南部21号

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ios ViewController present不同的方向相关的知识,希望对你有一定的参考价值。

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 ViewController present不同的方向的主要内容,如果未能解决你的问题,请参考以下文章

iOS学习笔记—ViewController/生命周期

iOS 瘦身ViewController 分离tableViewDataSource

检查当前 viewController 类是不是为 IOS 7 中的 Person ViewController 时出现问题

iOS 加载Viewcontroller的几种方法

根据 ios 版本不同的 ViewController

iOS 透明 ViewController