Created
June 12, 2019 18:24
-
-
Save shabib87/502d3e83f66ffb85b47570a8a606abd9 to your computer and use it in GitHub Desktop.
UI navigation using protocol oriented programming
This file contains 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 CanDisplayHeroDetailsScreen { | |
func displayHeroDetailsScreen(presenter aPresenter: Presenter) | |
} | |
extension CanDisplayHeroDetailsScreen where Self: UIViewController { | |
func displayHeroDetailsScreen(presenter aPresenter: Presenter) { | |
let detailsVC = HeroDetailsViewController.instantiateFromStoryboard(presenter: aPresenter) | |
navigationController?.pushViewController(detailsVC, animated: true) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment