Application: pass AppDelegate in initializer, instead of using singleton

This commit is contained in:
Andrew Breckenridge
2023-09-27 11:35:41 -07:00
committed by Stefan Ceriu
parent ee0539f260
commit 718e01f3bc
3 changed files with 16 additions and 21 deletions
@@ -20,7 +20,7 @@ import SwiftUI
struct Application: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) private var applicationDelegate
@Environment(\.openURL) private var openURL
private let appCoordinator: AppCoordinatorProtocol
private var appCoordinator: AppCoordinatorProtocol!
init() {
if ProcessInfo.isRunningUITests {
@@ -28,7 +28,7 @@ struct Application: App {
} else if ProcessInfo.isRunningUnitTests {
appCoordinator = UnitTestsAppCoordinator()
} else {
appCoordinator = AppCoordinator()
appCoordinator = AppCoordinator(appDelegate: applicationDelegate)
}
}
@@ -57,7 +57,7 @@ struct Application: App {
}
}
}
private var shouldHideStatusBar: Bool {
ProcessInfo.isRunningUITests
}