SwiftUI Light/Dark color doesn't work

Hi, I've followed this guide (Choose adaptive color for UI) https://developer.apple.com/documentation/appkit/supporting_dark_mode_in_your_interface


But still when I change the color schema to .dark the used color remains the "Any".


Is it a bug or do I have to do some configurations?

Replies

I am seeing this behavior as well when using a custom adaptive color defined in the asset catalog.

Yeap, I am having the same issue. It seems SwiftUI is half-baked at the moment and I doubt it will be ready for its release. There are many things broken, and many other not implemented.


I would love them to be upfront and put all the shortcomings in the release notes. Not for one minute I buy that they do not know dark color assets do not work with SwiftUI.


SwiftUI is a brilliant concept and I like it, but in my view, it won't be ready until next year. I think Apple is just testing the waters, putting the framework "out there". Next year, during the WWDC they will probably add and fix all the things that make the framework usuable... and as usual, we will all clap like crazy, for something that should have been there in the first place!

Problem still present in beta 2.

I found that I could use UIColor to get adaptive colors for things like UIAppearance but that Color for SwiftUI did not adapt (beta 2 at least).


I guess it is still under development; I'm always impressed that they announce with so much still to complete!

My impression is that they will release a core set of functionality 'on time'. The running story seems to be that anything that's not available can still be interchangably integrated from UIKit/AppKit