Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Load from Storyboard iOS Example
import UIKit
class ExampleViewController: UIViewController {
class func loadFromStoryboard(exampleService: ExampleService) -> ExampleViewController {
let exampleViewController:ExampleViewController =
UIStoryboard(name:"Main", bundle:NSBundle(forClass:self))
.instantiateViewControllerWithIdentifier("ExampleViewController")
as! ExampleViewController
exampleViewController.exampleService = exampleService
return exampleViewController
}
required init?(coder aDecoder: NSCoder) {
self.exampleService = AppEnvironment.sharedEnvironment.exampleService
super.init(coder:aDecoder)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment