简体   繁体   中英

How to set separate LaunchScreen storyboards for different targets in Xcode

I have an Xcode project with multiple targets. Basically each target is a customized version of my app for different clients. I've tried customizing the Launch Screen File based on user defined fields in each target's build settings and then using that variable in the info.plist to determine which Launch Screen. I'd prefer to maintain one info.plist using user defined build settings if possible.

You can also pick a different LaunchScreen on a per configuration basis, even within a single target. Just set a variable in your .xcconfig files like

LAUNCHSCREEN_NAME=launchscreen1

And then in a single Info.plist you can set UILaunchStoryboardName to $(LAUNCHSCREEN_NAME)

At build time, the selected configuration will determine which Launch Screen is used.

By LaunchScreen you mean initial views rather than launch screen (iOS 8+ style launch storyboard that replaced static launch images). Correct?

EDIT: The OP indeed meant launch storyboards. These can be individually set to each targets as they are specified in the form of Info.plist option and each target can have its own Info.plist file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM