From 4368e1d2318a96a3d4f56413c9d5afcb7db72a40 Mon Sep 17 00:00:00 2001 From: liam Date: Thu, 27 Aug 2020 15:28:02 +0800 Subject: [PATCH 1/3] [entryWindow] How to remove a UIWindow? https://stackoverflow.com/questions/4544489/how-to-remove-a-uiwindow --- Source/Infra/EKWindowProvider.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Infra/EKWindowProvider.swift b/Source/Infra/EKWindowProvider.swift index fb0a5dcb..d88c938e 100644 --- a/Source/Infra/EKWindowProvider.swift +++ b/Source/Infra/EKWindowProvider.swift @@ -147,6 +147,9 @@ final class EKWindowProvider: EntryPresenterDelegate { /** Clear all entries immediately and display to the rollback window */ func displayRollbackWindow() { + if #available(iOS 13.0, *) { + entryWindow.windowScene = nil + } entryWindow = nil entryView = nil switch rollbackWindow! { From 82c7d75491a261792fd63df99f25ecbdad3e4a24 Mon Sep 17 00:00:00 2001 From: liam Date: Mon, 26 Oct 2020 15:15:54 +0800 Subject: [PATCH 2/3] Update EKRootViewController.swift [rotate] supportedInterfaceOrientations default value is .all --- Source/Infra/EKRootViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Infra/EKRootViewController.swift b/Source/Infra/EKRootViewController.swift index 2647db34..03ca8c02 100644 --- a/Source/Infra/EKRootViewController.swift +++ b/Source/Infra/EKRootViewController.swift @@ -59,7 +59,7 @@ class EKRootViewController: UIViewController { override var supportedInterfaceOrientations: UIInterfaceOrientationMask { guard let lastAttributes = lastAttributes else { - return super.supportedInterfaceOrientations + return .all } switch lastAttributes.positionConstraints.rotation.supportedInterfaceOrientations { case .standard: From 12bb1a6cd23048d6f4d48e8906b72248e2008df7 Mon Sep 17 00:00:00 2001 From: liam Date: Thu, 12 Nov 2020 18:37:04 +0800 Subject: [PATCH 3/3] [interface] Dark mode requires setting the elements on the overrideUserInterfaceStyle of entryWindow value, for view to take effect --- Source/Infra/EKWindowProvider.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Source/Infra/EKWindowProvider.swift b/Source/Infra/EKWindowProvider.swift index 0cc96aa6..5e0204a1 100644 --- a/Source/Infra/EKWindowProvider.swift +++ b/Source/Infra/EKWindowProvider.swift @@ -65,6 +65,18 @@ final class EKWindowProvider: EntryPresenterDelegate { entryVC.setStatusBarStyle(for: attributes) entryWindow.windowLevel = attributes.windowLevel.value + + if #available(iOS 13.0, *) { + switch attributes.displayMode { + case .inferred: + entryWindow.overrideUserInterfaceStyle = .unspecified + case .light: + entryWindow.overrideUserInterfaceStyle = .light + case .dark: + entryWindow.overrideUserInterfaceStyle = .dark + } + } + if presentInsideKeyWindow { entryWindow.makeKeyAndVisible() } else {