今天遇到,模态弹出下滑返回,下滑返回和我本身的画图页面的滑动手势冲突,于是禁用下滑返回。
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就可以全屏幕