Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save SiarheiFedartsou/42070b7569551ecc33289ba6fb7ced4d to your computer and use it in GitHub Desktop.
Save SiarheiFedartsou/42070b7569551ecc33289ba6fb7ced4d to your computer and use it in GitHub Desktop.
protocol Visualizer : class {
func show(userName: String)
}
struct Router {
let navigationController: UINavigationController
func moveToAnotherScreen() {
// ...
}
}
class Presenter {
weak var visualizer: Visualizer? = nil
let router: Router
init(router: Router) {
self.router = router
}
func start() {
visualizer?.show(userName: "Siarhei Fedartsou")
}
func onUserAction() {
router.moveToAnotherScreen()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment