Created
March 10, 2017 19:29
-
-
Save SiarheiFedartsou/e902a7f064d0284c16b58a804614adef 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