Created
November 18, 2018 08:27
-
-
Save laevandus/e703c2281163508b0463f0309e94a04a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final class AppFlowController: UIResponder, AppFlowPresenting { | |
private let dependencyManager: DependencyManager | |
private let window: UIWindow | |
init(window: UIWindow, dependencyManager: DependencyManager) { | |
self.dependencyManager = dependencyManager | |
self.window = window | |
} | |
// MARK: Presenting Flows | |
func showInitialView() { | |
let controller = LoginFlowController(window: window) | |
controller.showInitialView() | |
activeFlow = controller | |
} | |
func showMainView() { | |
let controller = MainFlowController(window: window, dependencyManager: dependencyManager) | |
controller.showInitialView() | |
activeFlow = controller | |
} | |
// MARK: Managing the Responder Chain | |
var activeFlow: FlowPresenting? = nil | |
override var next: UIResponder? { | |
return activeFlow as? UIResponder | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment