Posts

Showing posts from September, 2020

Making app always in light mode

Image
  Dark Mode: Adding support to your app in Swift 1.  f you don’t have the time to add support for Dark mode you can simply disable it by adding the  UIUserInterfaceStyle  to your  Info.plist  and set it to  Light . 2.  Overriding Dark Mode per view controller You can override the user interface style per view controller and set it to light or dark using the following code: class ViewController : UIViewController { override func viewDidLoad ( ) { super . viewDidLoad ( ) overrideUserInterfaceStyle = . dark } } Overriding Dark Mode per view You can do the same for a single  UIView  instance: let view = UIView ( ) view . overrideUserInterfaceStyle = . dark Overriding Dark Mode per window Overriding the user interface style per window can be handy if you want to disable Dark Mode programmatically: UIApplication . shared . windows . forEach { window in window . overrideUserInterfaceStyle = . dark }...