how to restrict your app in light mode when Device is in Dark Mode for IOS 13

1k Views Asked by At

in your app Delegate. Just go to the func:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool
{
 if #available(iOS 13.0, *) {
        window?.overrideUserInterfaceStyle = .light
    }
     return true
}

Any suggestions....

3

There are 3 best solutions below

0
Afrah Tayyab On

Edit AppDelegate with follwing code.

func application(_application:UIApplication,didFinishLaunchingWithOptions launchOptions[UIApplication.LaunchOptionsKey: Any]?) -> Bool
{
 if #available(iOS 13.0, *) {
        window?.overrideUserInterfaceStyle = .light
    }
     return true
}
0
hecroge On

You can do it in the info.plist:

key: UIUserInterfaceStyle

string: Light

0
Siddhant Nigam On

open info.plist as a source code and add this:

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