however when you don't want to implement the darkmode because of some design conflict, ui conflict, here is how to disable dark mode.
add following code on viewDidLoad for each viewController as explained
override func viewDidLoad() {
super.viewDidLoad()
// Always adopt a light interface style.
overrideUserInterfaceStyle = .light
}
There is the other solution to make light style as a default for all view, which is to add key on info.plist. but this solution is not recommended by apple.
you can temporarily opt out by including theUIUser
key (with a value ofInterface Style Light
) in your app’sInfo
file. Setting this key to.plist Light
causes the system to ignore the user's preference and always apply a light appearance to your app.
Important
Supporting Dark Mode is strongly encouraged. Use the UIUser Interface Style
key to opt out only temporarily while you work on improvements to your app's Dark Mode support.for more information, see the link
0 件のコメント:
コメントを投稿