diff --git a/Source/Infra/EKWindow.swift b/Source/Infra/EKWindow.swift index d7cd128..767f3af 100644 --- a/Source/Infra/EKWindow.swift +++ b/Source/Infra/EKWindow.swift @@ -15,7 +15,7 @@ class EKWindow: UIWindow { init(with rootVC: UIViewController) { if #available(iOS 13.0, *) { // TODO: Patched to support SwiftUI out of the box but should require attendance - if let scene = UIApplication.shared.connectedScenes.filter({$0.activationState == .foregroundActive}).first as? UIWindowScene { + if let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene { super.init(windowScene: scene) } else { super.init(frame: UIScreen.main.bounds) diff --git a/Source/Infra/EKWindowProvider.swift b/Source/Infra/EKWindowProvider.swift index 5cd4e00..0b61ab7 100644 --- a/Source/Infra/EKWindowProvider.swift +++ b/Source/Infra/EKWindowProvider.swift @@ -77,7 +77,7 @@ final class EKWindowProvider: EntryPresenterDelegate { /** Boilerplate generic setup for entry-window and root-view-controller */ private func setupWindowAndRootVC() -> EKRootViewController { let entryVC: EKRootViewController - if entryWindow == nil { + if entryWindow == nil || rootVC == nil { entryVC = EKRootViewController(with: self) entryWindow = EKWindow(with: entryVC) mainRollbackWindow = UIApplication.shared.keyWindow