Skip to content

Instantly share code, notes, and snippets.

@SiarheiFedartsou
Created March 10, 2017 19:29
Show Gist options
  • Save SiarheiFedartsou/e902a7f064d0284c16b58a804614adef to your computer and use it in GitHub Desktop.
Save SiarheiFedartsou/e902a7f064d0284c16b58a804614adef 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