UIUserInterfaceStyle reverting to UIUserInterfaceStyleDark on each reopen

529 Views Asked by At

I'm having the strangest issue with a tvOS app where I check self.traitCollection.userInterfaceStyle to setup my UI according to light or dark mode in tvOS 10+.

On initial launch, all works as expected, and with the system in Light mode, UIUserInterfaceStyleLight is returned. However, by backgrounding and foregrounding the app (going out to the Home screen and back), the app all of a sudden returns UIUserInterfaceStyleDark. This is without changing the system appearance and even validating the system appearance remains set to Light.

Strangely enough, if I set the system to Dark then on each relaunch it returns UIUserInterfaceStyleLight, yet on initial launch it will be the proper UIUserInterfaceStyleDark.

What could be causing this?

2

There are 2 best solutions below

0
On

Do you know how to replace an image depending if tvOS is in dark mode or light mode? I added the dark mode images and light mode images already but not sure if I need to programmatically add the images also. Here is a screenshot of what I found to do in the assets.

enter image description here

0
On

Strangely, removing my base-level UINavigationController completely fixed this. It makes no sense to me how having a simple (stock) UINavigationController could override the values being returned from the system for Light/Dark mode, but either way that was the fix.