aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Tay <nick@windblume.net>2022-07-18 11:17:39 +1000
committerNicholas Tay <nick@windblume.net>2022-07-18 11:17:39 +1000
commit1f0dae4271c835276a57652f8ed27ec9bee4ccb6 (patch)
treedf094deefae45172b6ec3c1b8b257e3f379f963c
parent338256206f5e11d7e21a714dedb461ae89281526 (diff)
downloadforayios-1f0dae4271c835276a57652f8ed27ec9bee4ccb6.tar.gz
forayios-1f0dae4271c835276a57652f8ed27ec9bee4ccb6.tar.bz2
forayios-1f0dae4271c835276a57652f8ed27ec9bee4ccb6.zip
Pass through UIWindow to coordinatorHEADmaster
In case we need it later
-rw-r--r--foray/Coordinators/ForayCoordinator.swift4
-rw-r--r--foray/SceneDelegate.swift14
2 files changed, 10 insertions, 8 deletions
diff --git a/foray/Coordinators/ForayCoordinator.swift b/foray/Coordinators/ForayCoordinator.swift
index 70febce..fbd446a 100644
--- a/foray/Coordinators/ForayCoordinator.swift
+++ b/foray/Coordinators/ForayCoordinator.swift
@@ -11,10 +11,12 @@ import LinkPresentation
class ForayCoordinator: Coordinator {
var childCoordinators = [Coordinator]()
+ var window: UIWindow?
var navigationController: UINavigationController
var loadingOverlay: ForayLoadingOverlay
- init(navigationController: UINavigationController) {
+ init(window: UIWindow?, navigationController: UINavigationController) {
+ self.window = window
self.navigationController = navigationController
self.loadingOverlay = ForayLoadingOverlay(viewController: navigationController)
}
diff --git a/foray/SceneDelegate.swift b/foray/SceneDelegate.swift
index 1aabcd2..ed11dfe 100644
--- a/foray/SceneDelegate.swift
+++ b/foray/SceneDelegate.swift
@@ -20,13 +20,13 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
guard let windowScene = (scene as? UIWindowScene) else { return }
let nav = UINavigationController()
-
- self.coordinator = ForayCoordinator(navigationController: nav)
- self.coordinator?.start()
-
- self.window = UIWindow(windowScene: windowScene)
- self.window?.rootViewController = nav
- self.window?.makeKeyAndVisible()
+
+ window = UIWindow(windowScene: windowScene)
+ window?.rootViewController = nav
+ window?.makeKeyAndVisible()
+
+ coordinator = ForayCoordinator(window: window, navigationController: nav)
+ coordinator?.start()
}
func sceneDidDisconnect(_ scene: UIScene) {