您的位置:首页 > 移动开发 > IOS开发

iOS开发之自定义控制器切换

2015-12-11 18:07 483 查看
iOS8以后, 苹果公司推出了UIPresentationController, 通过其(presentedController 和 presentingController)来控制modal控制器操作.

我对跳转 进行了封装, 只需要将单例对象设置为 VC的 transitioningDelegate!

自定义modal步骤:

1. 设置过渡代理

  secVC.transitioningDelegate = [ROTransition sharedROTransition];

2. 设置展示样式为 UIModalPresentationCustom

   secVC.modalPresentationStyle = UIModalPresentationCustom;

3. 完成跳转

  [self presentViewController:secVC animated:YES completion:nil];

完整Demo [我的github](https://github.com/Jiaguanglei0418/DIYViewControrllerTransition)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: