Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
UI navigation using protocol oriented programming
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
You can’t perform that action at this time.