Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to Disable Dark mode in in my application

I just want override dark mode UI in my application. I added UIUserInterfaceStyle is Light. But i am not sure it is not working. Is there any other option?

like image 215
Suyash Avatar asked Feb 03 '26 08:02

Suyash


1 Answers

  • For entire App (Window):
window!.overrideUserInterfaceStyle = .light

You can get the window from SceneDelegate or any view.window

  • For a single ViewController:
viewController.overrideUserInterfaceStyle = .light

You can set any viewController, even inside the viewController itself

  • For a single View:
view.overrideUserInterfaceStyle = .light

You can set any view, even inside the view itself

You may need to use if #available(iOS 13.0, *) { ,,, } if you are supporting earlier iOS versions.

like image 187
Mojtaba Hosseini Avatar answered Feb 05 '26 23:02

Mojtaba Hosseini