Dark Mode for Today Widget

Problem:

The Widget Simulator does not support the dark mode correctly


Description:

I created a simple today widget to display just one label with the default text color (label color), and tested the widget using the "Widget Simulator", the text color is always black color no matter the system appearance is. (There is no problem for the main app to display correctly content in dark mode)


And even the text "Show Less..." and "Show More ..." in the widget always display in black color


Environment:

XCode Beta 6

Mojave Beta 10


Would you please help to suggest to actions to fix it?


Philip

Did you watch the video in WWDC18. There are detailed explanations on how to use dark mode.

Thanks,


I have no problem to migrate the main app to use the dark mode, the problem is only for the today widget.

We have the same issue. App works find in both dark/normal mode. Widget only works properly in normal mode and does not adapt to dark mode. We've added NSRequiresAquaSystemAppearance to the Widget's Info.plist as explained in the documentation - but that didn't help either. We use the latest XCode/Mojave builds.

After migrated to Mojave beta 11 and XCode 10 GM, still same problem. @Apple, is it ready for us to submit the app to app store?

I'm still seeing this on 10.14 (18A389) and Xcode 10.0 GM (10A255). The widget simulator shows an incorrect dark mode version of the widget (some views are aqua, others are dark). And the widget displays in Aqua mode in Mojave, regardless of the OS theme chosen.

Accepted Answer

Hi,

I had the same problem, and after some attempts I've discovered that the source of the problem is a value inside the Info.plist of the extension's target.

Try to change the value from 2.0 to 3.0 at path:


NSExtension > NSExtensionAttributes > NSExtensionPointVersion


P.S. I've not find this operation documented somewhere on Apple sites and at this moment I've not tryied the widget on old versions of macOS

was just about to post the same - that worked for me, too.

Perfect! Thanks for posting this - it works great.

This also helped me, but with a different problem. My app widget looked great in the simulator (dark transparent background, but had a white, intransparent background in the real sidebar) Problem fixed, thanks a lot!

Dark Mode for Today Widget
 
 
Q