IOS13的新特性,模态弹出禁用和启动下滑返回、全屏

今天遇到,模态弹出下滑返回,下滑返回和我本身的画图页面的滑动手势冲突,于是禁用下滑返回。

let autoGraphVc = AutoGraphVC()
autoGraphVc.delegate = self
autoGraphVc.modalPresentationStyle = UIModalPresentationStyle.fullScreen;
if #available(iOS 13.0, *) {
    autoGraphVc.isModalInPresentation = true
} else {
    // Fallback on earlier versions
}
self.superSelf?.present(UINavigationController(rootViewController:autoGraphVc), animated: true, completion: nil)

禁用下滑手势

UIViewController 的属性 isModalInPresentation 设为true 就能禁用下滑返回了 默认为 false

模态弹出全屏显示

UIViewController 的属性 modalPresentationStyle 控制模态弹出的类型 iOS 13之后,默认UIModalPresentationStyle.automatic,需要重新设置UIModalPresentationStyle.fullScreen就可以全屏幕

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。