SwiftUI custom launch screen?

3.7k views Asked by At

Switching from UIKit/Storyboards to SwiftUI, I am a bit confused about how to use a custom view as a launch screen, just as I would have before with LaunchScreen.storyboard.

So far, from all the tutorials I have found on the internet I have read that I should declare my background color and image as a dictionary in UILaunchScreen entry in Info.plist.

However, I feel like being offered much less choice than previously with a launch screen storyboard. Am I missing something?

Thank you for your help

1

There are 1 answers

0
Vladimir Sukanica On

In xCode 12.4, when you use SwiftUI, you don't have file "Launch Screen.storyboard" by default. There is no option in Info.plist to use custom custom launch screen. So you have to add it trough library, and edit it. After that you chose your .xcodeproj file from project navigator, and when you select your project name in TARGETS section, general tab, change Launch Screen File to the name of your launch screen.

Launch screen selection