My question is the opposite of this one : How to turn off Auto-Brightness programmatically?
When I set a custom screen brightness like that :
UIScreen.main.brightness = 0.1
, it disable the system auto brightness. To re-enable it, we have to lock and to unlock the phone. Is there any simple way to programmatically go back to automatic mode ?
Please note that I don't want to only back to the previous brightness level in "manual" mode like that :
if let previous = self.previousBrightness { UIScreen.main.brightness = previous }
If the ambient luminosity change in the meantime, that's not a great solution.
I imagine something like that :
UIScreen.main.brightnessMode = .auto