Created
March 27, 2019 18:45
-
-
Save KanshuYokoo/03aefa7c42905298df0827f8a69964fb to your computer and use it in GitHub Desktop.
ios, Xocde, swift, Open View from storyboard programatically on AppDelegate
This file contains hidden or 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
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
// Assume there are firstView and SecondView in the Main.storyboard | |
// open SecondView | |
window = UIWindow(frame: UIScreen.main.bounds) | |
let storyboad: UIStoryboard = UIStoryboard(name: "Main", bundle: nil) | |
let newViewController = storyboad.instantiateViewController(withIdentifier: "SecondView") as UIViewController | |
window!.rootViewController = newViewController | |
window!.makeKeyAndVisible() | |
return true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment