我刚刚将我的 iPhone 更新到 iOS 14 测试版,有人有适用于 Xcode 的 iOS 14 设备支持文件吗?我正在使用 Xcode 11。
在 iOS 13 中,模态视图控制器在呈现时有一个新行为。现在默认情况下它不是全屏的,当我尝试将 modalPresentationStyle 更改为 .fullScreen 时,我的视图会立即显示并关闭。我正在用代码呈现视图控制器:
if #available(iOS 13.0, *) {
var popupWindow: UIWindow?
let windowScene = UIApplication.shared
.connectedScenes
.filter { $0.activationState == .foregroundActive }
.first
if let windowScene = windowScene as? UIWindowScene {
popupWindow = UIWindow(windowScene: windowScene)
}
let vc = UIViewController()
vc.view.frame = UIScreen.main.bounds
popupWindow?.frame = UIScreen.main.bounds
popupWindow?.backgroundColor = .clear
popupWindow?.windowLevel = UIWindow.Level.statusBar + 1
popupWindow?.rootViewController = vc
popupWindow?.makeKeyAndVisible()
popupWindow?.rootViewController?.present(self, animated: true, completion: nil)
}
Run Code Online (Sandbox Code Playgroud)