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

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)

原文地址:https://www.cnblogs.com/guangleijia/p/5039839.html