Created
January 24, 2015 20:55
-
-
Save ibrennan/8d2d0edf0f92591d1a6a to your computer and use it in GitHub Desktop.
Swift - Initiate new view controller from AppDelegate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name of storyboard, without the .storyboard extension | |
var storyboard = UIStoryboard(name: "Main", bundle: nil) | |
// The type is the view controller class name, in this case 'ViewControllerLaunch' | |
// You need to make sure the view controller in storyboard has an identifier set | |
// The identifier in this example is 'Launch' | |
var viewController: ViewControllerLaunch = storyboard.instantiateViewControllerWithIdentifier("Launch") as ViewControllerLaunch | |
// Show this view controller | |
window?.rootViewController = viewController | |
window?.makeKeyAndVisible() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment