I using accelerometer in my app and i'm using [UIApplication sharedApplication].idleTimerDisabled = YES;
to prevent the device to sleep. It works fine, but this way the screen is always on full bright, there is a way to prevent the device to sleep and keep the energy economy mode on?
When idleTimerDisabled
is stetted to NO the device enter in the energy economy mode before sleep, i just want to prevent the device to sleep and keep the energy economy. There is a way to do that?
Asked
Active
Viewed 1,693 times
2

douglasd3
- 761
- 2
- 10
- 27
-
1This might help: http://stackoverflow.com/questions/1961783/dim-iphone-screen-but-dont-let-it-sleep – Anirudh Ramanathan Jul 14 '12 at 17:58
-
2This is on the border of Apple guidelines and your app may be rejected for doing this without very good reason. – Registered User Jul 14 '12 at 18:13
1 Answers
5
There's a property of UIScreen
instances, brightness
, that is likely what you want. Check out the documentation of UIScreen
's brightness
property here.
Try:
[[UIScreen mainScreen] setBrightness: 0.3];
NOTE: As I was posting, DarkXphenomenon posted a link to an SO question whose asker gave the exact same solution. DarkXphenomenon is quick on the draw.