diff --git a/Source/Alert/AlertController.swift b/Source/Alert/AlertController.swift index c8728eb..cdd17c1 100644 --- a/Source/Alert/AlertController.swift +++ b/Source/Alert/AlertController.swift @@ -96,7 +96,7 @@ public extension Alert { window.resignKey() window.addSubview(view) if #available(iOS 13.0, *) { - window.windowScene = cfg.windowScene ?? UIApplication.shared.windows.last?.windowScene + window.windowScene = cfg.windowScene ?? UIApplication.shared.windows.first?.windowScene } else { // Fallback on earlier versions } diff --git a/Source/Toast/ToastController.swift b/Source/Toast/ToastController.swift index ca9268c..19a0222 100644 --- a/Source/Toast/ToastController.swift +++ b/Source/Toast/ToastController.swift @@ -120,7 +120,7 @@ public extension Toast { let window = UIWindow(frame: .zero) self.window = window if #available(iOS 13.0, *) { - window.windowScene = cfg.windowScene ?? UIApplication.shared.windows.last?.windowScene + window.windowScene = cfg.windowScene ?? UIApplication.shared.windows.first?.windowScene } else { // Fallback on earlier versions }