From b938a99c359f2abd32a4f768a065af69d48bf2af Mon Sep 17 00:00:00 2001 From: Alexander Israel Date: Sun, 3 Apr 2022 14:37:37 +0300 Subject: [PATCH 1/2] fix for rootVC issue --- Source/Infra/EKWindowProvider.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Infra/EKWindowProvider.swift b/Source/Infra/EKWindowProvider.swift index 5cd4e00a..0b61ab74 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 From d39ab6380db13cf6e17fb1e20e93ffc9d7fde63a Mon Sep 17 00:00:00 2001 From: Alexander Israel Date: Sun, 12 May 2024 13:28:32 +0300 Subject: [PATCH 2/2] Update EKWindow.swift --- Source/Infra/EKWindow.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Infra/EKWindow.swift b/Source/Infra/EKWindow.swift index d7cd1280..767f3aff 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)