1

I want to have a dark mode option within the settings page of my Xcode swift app. Is it possible to change dark mode just for the app, on all view controllers in the app? I have my dark colors selected in 'Assets.xcassets'

Henhen1227
  • 392
  • 1
  • 3
  • 12
  • 3
    Does this answer your question? [How to switch programmatically to dark mode swift](https://stackoverflow.com/questions/60171262/how-to-switch-programmatically-to-dark-mode-swift) – hisam Aug 15 '20 at 23:50

1 Answers1

3

If you want to set your app to be only on dark mode, you can simply add

overrideUserInterfaceStyle = .dark

to your viewDidLoad(), or if you want it to be on the entire app:

  • Go to your Info.plist file
  • Add new key: UIUserInterfaceStyle with value Dark
אורי orihpt
  • 2,358
  • 2
  • 16
  • 41