Small tweaks.
This commit is contained in:
@@ -10,7 +10,7 @@ import UIKit
|
||||
@main
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
private var appCoordinator: Coordinator!
|
||||
private lazy var appCoordinator: Coordinator = isRunningUITests ? UITestsAppCoordinator() : AppCoordinator()
|
||||
|
||||
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
|
||||
|
||||
@@ -26,13 +26,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
return true
|
||||
}
|
||||
|
||||
if isRunningUITests {
|
||||
appCoordinator = UITestsAppCoordinator()
|
||||
} else {
|
||||
appCoordinator = AppCoordinator()
|
||||
}
|
||||
|
||||
appCoordinator.start()
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@@ -22,11 +22,11 @@ class UITestsAppCoordinator: Coordinator {
|
||||
|
||||
let screens = mockScreens()
|
||||
let rootView = UITestsRootView(mockCoordinators: screens) { id in
|
||||
guard let coordinator = screens.filter({ $0.id == id }).first else {
|
||||
guard let screen = screens.filter({ $0.id == id }).first else {
|
||||
fatalError()
|
||||
}
|
||||
|
||||
self.mainNavigationController.pushViewController(coordinator.coordinator.toPresentable(), animated: true)
|
||||
self.mainNavigationController.pushViewController(screen.coordinator.toPresentable(), animated: true)
|
||||
}
|
||||
|
||||
mainNavigationController.setViewControllers([UIHostingController(rootView: rootView)], animated: false)
|
||||
|
||||
Reference in New Issue
Block a user