This is what I am truing to do on this iO7 or later app:
When the user opens my app, I want to get the screen brightness value and turn up the brightness all the way. When the user leaves the app, I want the brightness to go back to previous value.
So far I use this:
-(void) applicationWillResignActive
{
[[UIScreen mainScreen] setBrightness:oldScreenBrightness];
}
-(void) applicationDidBecomeActive
{
screenBrightness = [UIScreen mainScreen].brightness;
[[UIScreen mainScreen] setBrightness:1.0];
}
This works fine, except, if the user adjusts the brightness via Control Center WHILE using the app, it will still go back to the old brightness upon leaving the app when it should not.
So I was wondering, if I can Key Value Observe [UIScreen mainScreen].brightness and check if it's changed by the user to omit changing it back to old value....