Objective-C:
// 设置屏幕常亮,默认是NO
[UIApplication sharedApplication].idleTimerDisabled = YES;
// 设置窗口亮度大小,范围是0.1 - 1.0
[UIScreen mainScreen] setBrightness: 0.5];
Swift:
UIApplication.shared.idleTimerDisabled = true
Objective-C:
// 设置屏幕常亮,默认是NO
[UIApplication sharedApplication].idleTimerDisabled = YES;
// 设置窗口亮度大小,范围是0.1 - 1.0
[UIScreen mainScreen] setBrightness: 0.5];
Swift:
UIApplication.shared.idleTimerDisabled = true