How to change the entry point of a Ios App?

999 Views Asked by At

I want to change my entry Point of my project but how I can do that? I don't use the storyboard, I do it all programmatically and I want my secondViewController to be the firstViewController. Thanks in advance!

1

There are 1 best solutions below

1
On BEST ANSWER

without storyboard start with your specific ViewController put this code in didfinishlaunchingwithOptions method in AppDelegate.

let homeVC = SecondViewController()
self.window?.rootViewController = homeVC
self.window?.makeKeyAndVisible()

with storyboard

let storyboard = UIStoryboard.init(name: "Main", bundle: nil)
let homeVC = storyboard.instantiateInitialViewController()
self.window?.rootViewController = homeVC
self.window?.makeKeyAndVisible()