DarkMode doesn't work on Mojave when exported from archive

蓝咒 提交于 2019-12-13 04:34:18

问题


I use Xcode 10 and added all required stuff for DarkMode support. When I run the project on Mojave everything works. But when I archive and distribute the app using Xcode 10 on HighSierra, then my app doesn't appear in dark mode on Mojave. Shouldn't Xcode 10 archive Mojave compatible version anyway?


回答1:


Possible reasons:

  • You are using command line to create the archive, but your toolchain is set to use Xcode 9
  • You are using Dark Mode specific assets in asset catalog. Dark versions of those assets can only be compiled using Mojave.



回答2:


For some reason, the asset catalog created with Xcode 10 only contains the dark mode colors and images if Xcode is run on a macOS 10.14 Mojave system or newer! This means for full Dark Mode support it's not enough to just use Xcode 10, you must run Xcode on macOS 10.14 or newer.

The Cocoa APIs for Dark Mode can still be used, so you can compile an app supporting Dark Mode with Xcode 10 on macOS 10.13, but the asset support will be missing.



来源:https://stackoverflow.com/questions/52872730/darkmode-doesnt-work-on-mojave-when-exported-from-archive

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