假設(shè)你需要保持全屏的segue跳轉(zhuǎn),發(fā)現(xiàn)從iOS 13開始變成了PageSheet的方式。你需要注意一下事項(xiàng):
如果在iOS 13以后舌厨,從UIViewController進(jìn)行modal跳轉(zhuǎn),請(qǐng)不要使用Deprecated Segues中的Modal,而是使用Adaptive Segues中的Present Modally狰挡。
Screen Shot 2019-11-26 at 9.38.41 AM.png
在Presentation中使用Full Screen。
Screen Shot 2019-11-26 at 9.40.43 AM.png
至于原因释涛,是因?yàn)閕OS 13的升級(jí)加叁,注意以下描述,我做了翻譯:
/*
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.
這個(gè)屬性描述了這個(gè)VC被modal跳轉(zhuǎn)的時(shí)候使用的樣式唇撬。在被展示的VC使用這個(gè)屬性它匕,而不是展示者。這個(gè)值的默認(rèn)值是UIModalPresentationAutomatic(iOS 13或以上)窖认,或者UIModalPresentationFullScreen(iOS 13以下或非iOS平臺(tái))豫柬。UIViewController把UIModalPresentationAutomatic解析成UIModalPresentationPageSheet告希,但是UIViewController的子類會(huì)把UIModalPresentationAutomatic解析成其他值
*/
@property(nonatomic,assign) UIModalPresentationStyle modalPresentationStyle API_AVAILABLE(ios(3.2));