Search code examples
objective-ciosbrightnessuiscreen

uiscreen brightness beyond maximum value


I know it's possible to change the brightness of the iphone screen through code with

[[UIScreen mainScreen] setBrightness:1.0];

but I wonder if it's possible to go beyond the maximum brightness level which is set in iPhone, and make the screen even brighter?

I'm thinking of an App which would use the screen as some sort of light source, but in the context I'm thinking of the maximum brightness isn't enough. (the iphone should be hooked up to a powersupply obviously otherwise the battery would be dead in an hour)

So, is this even possible (I think it's not, as max float is 1.0) and does apple accept apps which go beyond their own settings?


Solution

  • It is not possible to set the Brightness higher than 1.0. It will get clipped to 1.0. You can easily find that out when you try setting it to a higher value and afterwards read it out like this:

    [[UIScreen mainScreen] setBrightness:2.0];
    NSLog(@"Brightness: %f",[UIScreen mainScreen].brightness);
    

    it will print out: Brightness: 1.000000