Search code examples
iosreact-nativestoryboardsplash-screen

How to set storyboard on launch in iOS?


On application load storyboard appears only for few seconds and after white screen appears till the app is loaded. How exclude white screen so user would see only storyboard till the app is loading?


Solution

  • If you see your launch storyboard for a bit, then it switches to a white screen, my guess is that you're doing too much in application(_:didFinishLaunchingWithOptions:). The launch storyboard will go away when either

    1. Your main storyboard's initial view controller is loaded.
    2. You assign something to the window's rootViewController property.

    Check for work in application(_:didFinishLaunchingWithOptions:) that blocks the main thread, which will delay the display of your app's real UI.

    Edit: I see your react-native tag, so the above is probably not directly applicable to you. I'm not a RN guru, but a quick check of the docs leads me to think that you need to dig into the initial component in your app and look for things in there that might hold up rendering. It's the same idea as my suggestion above, just in a different context.