Created
March 10, 2017 19:27
-
-
Save SiarheiFedartsou/42070b7569551ecc33289ba6fb7ced4d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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