问题
I just downloaded Xcode 11 Beta 4 and when I want to build my Swift 4 project gives me:
UILaunchImages has been deprecated, use launch storyboards instead
How can I fix it?
回答1:
Please read the release notes for Xcode 11 beta 4:
Known Issues
Your app might fail to build if it contains a launch image. The failure message resembles the following: “The launch image set named <image set name> did not have any applicable content.” Launch images are deprecated and should be removed; use a launch storyboard or .xib file instead. (50210495)
Workaround: Clear the build setting ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME.
回答2:
- add a new storyboard to your project
- name it LaunchScreen.storyboard and save
- add a new view controller to your LaunchScreen, add an imageView, and reference your launch image
- make LaunchScreen.storyboard your initial view controller in the Attributes Inspector (make sure to uncheck the old initial view controller)
- in your General settings (App Icons and Launch Images) in the Launch Screen File dropdown, select LaunchScreen
After testing, to get rid of compiler warnings, delete the LaunchImage folder in Images.xcassets, and in Build Settings, delete LaunchImage (in Debug and Release) from Asset Catalog Launch Image Set Name.
回答3:
Xcode -> File -> New -> File... -> Launch Screen.
Select Target -> Build Settings -> Search "LaunchImage" & delete string from (Debug and Release) Asset Catalog Launch Image Set Name.
Select "Assets.xcassets" & remove LaunchImage from it.
Build & Run.......enjoy
回答4:
In my case a couple things were happening...
- I had in my Info.plist file UILaunchImages which was causing this warning. After deleting it, the warning went away.
- On the General tab of my ProjectTraget the Launch Screen File was empty. So, adding my launch screen file there from the drop down made my app launch correctly again (This was my main storyboard file).
I hope this helps anyone else having the same warning, and also their app looking letter-boxed.
来源:https://stackoverflow.com/questions/57084407/xcode-11-uilaunchimages-has-been-deprecated-use-launch-storyboards-instead-warn