Skip to content

Instantly share code, notes, and snippets.

@shabib87
Created May 10, 2019 23:56
Show Gist options
  • Save shabib87/309565f62b3bf75b10ab76a743e069e9 to your computer and use it in GitHub Desktop.
Save shabib87/309565f62b3bf75b10ab76a743e069e9 to your computer and use it in GitHub Desktop.
Overriding root view controller confronting to StoryboardInitializable to initialize from storyboard
final class HeroDetailsViewController: RootViewController {
override class func instantiateFromStoryboard(presenter aPresenter: Presenter) -> UIViewController {
let vc = UIStoryboard(name: "Hero", bundle: nil)
.instantiateViewController(withIdentifier: "HeroDetailsViewController")
as! HeroDetailsViewController
vc.presenter = aPresenter as? HeroDetailsPresenter
return vc
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment