diff --git a/Source/Infra/EKWindow.swift b/Source/Infra/EKWindow.swift index d7cd128..590c5f5 100644 --- a/Source/Infra/EKWindow.swift +++ b/Source/Infra/EKWindow.swift @@ -15,7 +15,9 @@ 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 { + let scenes = UIApplication.shared.connectedScenes + let candidateScene = scenes.first { $0.activationState == .foregroundActive } ?? scenes.first + if let scene = candidateScene as? UIWindowScene { super.init(windowScene: scene) } else { super.init(frame: UIScreen.main.bounds)