UIViewController
有个属性modalPresentationStyle
,它决定了当前控制器 present 出的下一控制器的展示方式。
官方文档对这些效果有比较详细的介绍,这里写个 demo 帮助理解,demo 在模拟器上运行可能会有一点卡顿,真机没有影响。
预备知识
presenting、presented viewController
presentingViewController
指的是 present 出当前控制器的控制器。
presentedViewController
指被当前控制器 present 出的控制器。
Size Class
对于各种常见情况的 Size Class 如下几张图片所示:
UIModalPresentationStyle
enum