Search code examples
iosswiftsplash-screen

Swift programatic splash screen


Is it possible to make the splashscreen/LaunchScreen programatically? And if so how?

I currently have a launchscreen.xib file. But I'd like to convert this into a .swift file with code instead.

However I havn't been able to find anything on how to do a launchscreen purely programatically.


Solution

  • The whole point of a launch screen is that it's shown before your code is ready to run. So that it can load quickly, it can only be an image or a xib.

    You can certainly swap in a programmatic screen which looks the same after the launch screen shows, but you can't put code in that initial screen.