Search code examples
iosios13ios-darkmode

Any, Dark for colors and Any, Light, Dark for images, why?


I am adapting an existing app to dark mode.

A certain view uses an image to represent the state of a feature. I have selected the image inside the assets catalog and modified its Appearances field from none to Any, Dark. Then I added images for the Dark mode and nope. When I run the app, the image does not appear when the device is on Light mode. That forced me to change that image from Any, Dark to Any, Light, Dark and then define images for the light mode.

I had a label on the same view and I changed that view to Any, Dark just to check and it worked properly.

Why one view works and the other doesn't? Bug?

Should I change that label to Any, Light, Dark?


Solution

  • You need to put the light image into Any if you only have light and dark.

    Any is used in iOS 12 and below where dark mode is not yet available. If you, for instance, had a dark theme before iOS 13, then you would put all your dark assets in Any and Dark and the (new) light assets in Light. This way the app remains dark in iOS <= 12.