How to adopt dark mode without loosing support for older iOS versions?

204 Views Asked by At

We are supporting iOS 10 and above hence I had to use XCode 10 or else AppStore Connect gives me an error that the minimum iOS version should be 12.4 when using XCode 11. How can I adopt dark mode for newer iOS versions without losing support for iOS 10?

1

There are 1 best solutions below

0
elarcoiris On

A simple iOS version check in viewDidLoad will do:

if #available(iOS 13.0, *) {
    overrideUserInterfaceStyle = .light // example
}

If your user is using 13+, then display your dark mode preferences.