Skip to content

Instantly share code, notes, and snippets.

@prostakm
Last active November 16, 2017 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prostakm/1144ee71060d7e6be3fafc211ee71b8a to your computer and use it in GitHub Desktop.
Save prostakm/1144ee71060d7e6be3fafc211ee71b8a to your computer and use it in GitHub Desktop.
class ModuleConnector {
weak var navigationController: UINavigationController?
init(navigationController: UINavigationController) {
self.navigationController = navigationController
}
func connect() {
let gateway = StaticDataGateway()
let useCase = ShowDataUseCase(dataGateway: gateway)
let presenter = ViewPresenter(useCase: useCase, connector: self)
let view = ViewController(presenter: presenter)
presenter.view = view
navigationController?.pushViewController(view, animated: true)
}
}
ModuleConnector(navigationController: UINavigationController(nibName: nil, bundle: nil)).connect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment