How to load UIViewController programmatically from storyboard?
Full Swift 3 code including instantiation of Storyboard:
let storyboard = UIStoryboard.init(name: "Main", bundle: Bundle.main)
if let mainViewController = storyboard.instantiateInitialViewController() {
present(mainViewController, animated: false, completion: nil)
}
The way you're doing this just creates a new instance of your view controller. It does not create one from the prototype you've defined in Interface Builder. Instead, you should be using this, where "SomeID" is a storyboard ID that you've assigned to your view controller in Interface Builder.
if let resultController = storyboard!.instantiateViewControllerWithIdentifier("SomeID") as? ResultViewController {
presentViewController(resultController, animated: true, completion: nil)
}
You can assign a storyboard ID to your view controller in Interface Builder's identity inspector.