假设你需要保持全屏的segue跳转,发现从iOS 13开始变成了PageSheet的方式。你需要注意一下事项:
如果在iOS 13以后,从UIViewController进行modal跳转,请不要使用Deprecated Segues中的Modal,而是使用Adaptive Segues中的Present Modally。
在Presentation中使用Full Screen。
至于原因,是因为iOS 13的升级,注意以下描述,我做了翻译:
/*
Defines the presentation style that will be used for this view controller when it is presented modally. Set this property on the view controller to be presented, not the presenter.
If this property has been set to UIModalPresentationAutomatic, reading it will always return a concrete presentation style. By default UIViewController resolves UIModalPresentationAutomatic to UIModalPresentationPageSheet, but system-provided subclasses may resolve UIModalPresentationAutomatic to other concrete presentation styles. Participation in the resolution of UIModalPresentationAutomatic is reserved for system-provided view controllers.
Defaults to UIModalPresentationAutomatic on iOS starting in iOS 13.0, and UIModalPresentationFullScreen on previous versions. Defaults to UIModalPresentationFullScreen on all other platforms.
这个属性描述了这个VC被modal跳转的时候使用的样式。在被展示的VC使用这个属性,而不是展示者。这个值的默认值是UIModalPresentationAutomatic(iOS 13或以上),或者UIModalPresentationFullScreen(iOS 13以下或非iOS平台)。UIViewController把UIModalPresentationAutomatic解析成UIModalPresentationPageSheet,但是UIViewController的子类会把UIModalPresentationAutomatic解析成其他值
*/
@property(nonatomic,assign) UIModalPresentationStyle modalPresentationStyle API_AVAILABLE(ios(3.2));