Skip to content

Instantly share code, notes, and snippets.

@gspiers
Last active March 1, 2018 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gspiers/67171370fbf55f60aca35b06ee578d54 to your computer and use it in GitHub Desktop.
Save gspiers/67171370fbf55f60aca35b06ee578d54 to your computer and use it in GitHub Desktop.
// Stringly typed 💩
// This throws an Obj-C exception and crashes if you get the name wrong. It would be better if it returned an optional.
let bootstrapRootStoryboard = UIStoryboard(name: "BootstrapRoot", bundle: Bundle.main)
guard let appKilledViewController = bootstrapRootStoryboard.instantiateViewController(withIdentifier: "appKilledViewController") as? AppKilledViewController else {
fatalError("Unexpected viewcontroller for identifier 'appKilledViewController'")
}
// Strongly typed using SwiftGen 😀
let appKilledViewController = StoryboardScene.BootstrapRoot.instantiateAppKilledViewController()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment