Dark mode changes

Hi All,

In case you have an app that goes south on Dark mode (I had several) I needed to make some adjustments to the UI to account for this. The first step was to determine if the user’s device was set to Dark Mode. Lucky there is some simple code to sniff this out:

if traitCollection.userInterfaceStyle == .light {
print(“Light mode”)
} else {
print(“Dark mode”)

Good luck with the changeovers! Some are really giving me a headache!

1 Like

Thanks for sharing that Mark!!