1

I am bit confused right now, am trying to add support for dark mode for my old application. But I don't understand that if we have to add two images for single asset for both dark mode and light mode. It’s not always the best option to add extra assets for each appearance. In the end, it makes your app size bigger.

Already my application size is too heavy. And I can't afford to add new images for dark mode.

It seems that it increase a lot of work for both developers and designers. So now, my designer has to provide me all the new images for dark mode which is tough?

We are working on this project from last 2 years and we have lots of icons in our application. So that's not possible for us to create the new icons for dark mode and then add it.

Please help me this issue?

Do we have any other option in which Xcode could generate the icons for dark mode by itself? And we can use that one instead of creating the icons from designer for dark mode and then add it.

Please help me and am sorry for my bad English!

enter image description here

Mandeep Singh
  • 2,810
  • 1
  • 19
  • 31

2 Answers2

1

You don't have to provide separate assets for dark mode. In the attributes inspector, after selecting your image, under Appearance, just select None instead of Any, Dark. Then this one image will be used for both modes.

Frank Rupprecht
  • 9,191
  • 31
  • 56
  • Thanks for your efforts. Are you sure? But suppose if I have black image of icon which is looking good on White screen. After applying dark mode, my screen becomes black at that case my black icon should become white or it stays as a black icon. – Mandeep Singh Nov 15 '19 at 08:44
  • 1
    For that you can use tinting: Set the render mode (`Render As` in the attributes inspector) to `Template Image`, then iOS will re-color the image depending on the `tintColor` that is set on the `UIImageView` your image is displayed in. Most system controls already set tint colors for light and dark mode correctly. – Frank Rupprecht Nov 15 '19 at 08:46
  • 1
    If you want to have more than one color however, you need to provide two different images for light and dark mode. – Frank Rupprecht Nov 15 '19 at 08:48
  • That's my main question that should I have to provide 2 images or not. Thank You – Mandeep Singh Nov 15 '19 at 08:49
  • Yes, unless it's a single-color image that you could tint, you need to provide two different images if you want them to look different in light and dark mode. – Frank Rupprecht Nov 15 '19 at 08:51
  • If I have multiple shades of color in image then I have to provide different images for both dark and light mode. Am I right? – Mandeep Singh Nov 15 '19 at 08:52
  • Right. Unless of course, you find that the image looks good in both modes. – Frank Rupprecht Nov 15 '19 at 08:53
0

simply add "UIUserInterfaceStyle" key "Light" in project info.plist.enter image description here

Sushobhit
  • 305
  • 4
  • 18