Reputation: 434
I created my views in code. The starting point is the didFinishLaunchWithOptions function in the Appdelegate class.
window = UIWindow(frame: UIScreen.main.bounds)
window?.makeKeyAndVisible()
let controller = ViewController() // create an instance of my ViewController and set it to the rootViewController
window?.rootViewController = controller
I would like to add a launch screen that appears instantly when your app starts up. The launch screen should be quickly replaced with the first screen of the app, giving the impression that your app is fast and responsive. I found some answers that said it is not possible(Is there any way to code the LaunchScreen programmatically). My idea was creating a new launchView and replace it through NSTimer. Isn't there any easier or alternative way ?
Thanks
Upvotes: 1
Views: 2753
Reputation: 5467
This is not possible as such as the Launch Screen is not a regular View Controller and it cannot hold any logic. Any animations which are there in the App during startup are handled after the launch Screen has appeared and the animations are in the root view controller as in Twitter app. If you are completely against using launch Screens then an alternative would be make a view in IB and use its screenShot as a splashImage. There is no way as of now to make a launchScreen programatically or to add any logic to it.
Upvotes: 4