user1841702 user1841702 - 2 years ago 141
Swift Question

How to transition from LaunchScreen to main page in Swift?

I am new to programming with Swift. I wanted to know how to create an app from scratch (from the beginning as in with no launchscreen, no first page, and no storyboards) - I deleted all my ViewControllers and their associated storyboards along with the launch screen. I managed to get the splash screen working but I am unable to make it transition to the first page (also currently present).

Things I have done:
Created new storyboard containing main page's view controller and associated swift file extending UIViewController. Also linked the two.

But I cannot get the lauchscreen to transition to the main page. Any help with this would be most appreciated. I also tried comparing with other Swift projects but I do not know how to proceed.

Answer Source

You must point your target's Main Interface to your Storyboard. enter image description here

In code you would have to, in the AppDelegate, create an UIWindow instance with frame set to NSScreen.mainScreen.bounds, create your view controller programmatically, set your controller as the window's rootViewController, then call makeKeyAndVisible on the window.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download