From fd8cb906b7c668c7800bfb91e1f89893d4fc50a4 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Tue, 30 Jun 2020 17:47:18 +0800 Subject: [PATCH] first window scene --- Source/Alert/AlertController.swift | 2 +- Source/Toast/ToastController.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 }