I read Apple Article for disable Dark Mode because I need disable for my all UIViewController and i haven't any BaseUIViewController.
How can I disable Dark Mode for all UIViewController without using any BaseUIViewController? I don't want to write the following code over and over again.
Is there a solution to this?
override func viewDidLoad() {
super.viewDidLoad()
// Always adopt a light interface style.
overrideUserInterfaceStyle = .light
}
Here's how: Go to Settings. Select Display & Brightness. Turn Dark Mode on or off.
On your phone, open the Settings app. Tap Display. Turn Dark theme on or off.
Android MessagesIn Messages, tap the three-dot menu and select Choose Theme from the drop-down. You can then make the app light, dark, or match it to the system default theme.
If you don't want to use Dark interface style or you have an existing app and you don't have much time to implement dark mode changes, in that case, you can simply disable it by adding the UIUserInterfaceStyle to your Info. plist and set it to Light .
You can force light/dark mode in your whole application regardless of the user's settings by adding the key UIUserInterfaceStyle
to your Info.plist
file and setting its value to either Light or Dark.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With