Xcode 11 UILaunchImages has been deprecated, use launch storyboards instead Warning

浪尽此生 提交于 2020-05-24 21:17:07

问题


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:


  1. Xcode -> File -> New -> File... -> Launch Screen.

  2. Select Target -> Build Settings -> Search "LaunchImage" & delete string from (Debug and Release) Asset Catalog Launch Image Set Name.

  3. Select "Assets.xcassets" & remove LaunchImage from it.

  4. Build & Run.......enjoy




回答4:


In my case a couple things were happening...

  1. I had in my Info.plist file UILaunchImages which was causing this warning. After deleting it, the warning went away.
  2. 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!