first window scene

This commit is contained in:
xaoxuu 2020-06-30 17:47:18 +08:00
parent 7a0eaac1ae
commit fd8cb906b7
2 changed files with 2 additions and 2 deletions

View File

@ -96,7 +96,7 @@ public extension Alert {
window.resignKey() window.resignKey()
window.addSubview(view) window.addSubview(view)
if #available(iOS 13.0, *) { if #available(iOS 13.0, *) {
window.windowScene = cfg.windowScene ?? UIApplication.shared.windows.last?.windowScene window.windowScene = cfg.windowScene ?? UIApplication.shared.windows.first?.windowScene
} else { } else {
// Fallback on earlier versions // Fallback on earlier versions
} }

View File

@ -120,7 +120,7 @@ public extension Toast {
let window = UIWindow(frame: .zero) let window = UIWindow(frame: .zero)
self.window = window self.window = window
if #available(iOS 13.0, *) { if #available(iOS 13.0, *) {
window.windowScene = cfg.windowScene ?? UIApplication.shared.windows.last?.windowScene window.windowScene = cfg.windowScene ?? UIApplication.shared.windows.first?.windowScene
} else { } else {
// Fallback on earlier versions // Fallback on earlier versions
} }