HariKarthick
HariKarthick

Reputation: 1497

How to support support dark mode for existing swift app iOS?

I am using Xcode version 11.3.1 and we have not supported the dark mode feature in the latest build. while checking the dark mode in iOS13, all the texts are not visible. It’s working in light mode. But I need to support dark mode as well.

While checking in the dark mode issue, I found solution like below to set the light mode for entire app even if the user select the dark mode:

<key>UIUserInterfaceStyle</key>
<string>Light</string>

But some of them mentioned, if we set this UIUserInterfaceStyle in plist, it will not allow placing the submit the app to App Store.

My question is, I want to support dark mode and I want to submit the app into App Store as well.

or

I need to support only light mode and I want to submit the app into the app store as well.

Note: I am using the app delegate not using SwiftUI.

enter image description here

Upvotes: 2

Views: 4777

Answers (2)

Apps Maven
Apps Maven

Reputation: 1420

To make your app look the same in the dark mode as well and it does not hinder the existing UI of the app you can use this line of code in

info.plist <key>UIUserInterfaceStyle</key>
<string>Light</string>

In this way your app will only will support only the light mode.

Upvotes: 2

Faysal Ahmed
Faysal Ahmed

Reputation: 7669

if you don't set UIUserInterfaceStyle on info.plist then the App automatically enables dark mode depends on the system. If the system runs with dark mode then the app will start with dark mode.

But to show all the texts or other things you have to use the system color as the background and also for texts. OR you can use a custom color for dark mode or light mode.

Upvotes: 3

Related Questions