Dim brightness programmatically below standard

I'm developing an app where a screen need to be as dark as possible (the app need to run in a room all night long). I already set a black background and the brightness to 0 using :


UIScreen.main.brightness = (0.0)


But it's still too bright for a good comfort of use.

I've searched around the internet and found:


UIScreen.main.wantsSoftwareDimming = true


That I put before my previous code line, but nothing changed.

I've tried the trick with accessibility settings and zoom things, that works well, but that's not a way I'm allowed to use.

So, I'm a bit out of idea and any help would be appreciated.

Is it even still possible to do it? Is it possible to turn off the backlight? (That would be the best)

I'm looking for the identical solution and have the identical resluts so far. I was disappointed that

UIScreen.main.wantsSoftwareDimming = true
UIScreen.main.brightness = 0

seems to have done nothing more than the 2nd statement on its own. Both leave the screen lit at what looks like 5%. Certainly not black.


Older solutions used the proximity detector, like when you put the phone to your ear, and required the phone to be placed face down on a surface to balnk the screen. My understanding is that this is no longer available. I'm taking a hunt for it right now...


Well waddya know, the proximity thing works.

UIDevice.current.isProximityMonitoringEnabled = true


This dims the screen to full black when the phone is near your ear or any surface. I'm not sure but I don't think you can fake the proximity monitor programmatically, and that's the functionality that was removed. Now you can only turn the monitor on or off.


This might be a solutoin for me but maybe not for you, if you need the screen to still be active.

Dim brightness programmatically below standard
 
 
Q