Inconsistent light/dark mode application

Viewed 71

My team and I have noticed a very annoying bug in our app on macOS 12. We have implemented a light/dark mode for our app. Everything seems to work just fine on macOS 11.X and before but on macOS 12+ some of the UI elements don't seem to be getting the message that they need to use a different color depending on the appearance mode.

We define the colors in a ColorSet in our assets file with the "Any,Dark" appearance and set the color in the view's layer's backgroundColor property. It seems like no matter what appearance we set in app the UI element only shows the color consistent with the system appearance (ie app is in light mode but system is in dark mode. UI elements show dark mode). It seems to be happening on view controllers that have been added as children to a parent view controller. The parent seems to be updating its colors correctly but the child not so much.

0 Answers
Related