Objective-C:
// 設(shè)置屏幕常亮,默認(rèn)是NO
[UIApplication sharedApplication].idleTimerDisabled = YES;
// 設(shè)置窗口亮度大小,范圍是0.1 - 1.0
[UIScreen mainScreen] setBrightness: 0.5];
Swift:
UIApplication.shared.idleTimerDisabled = true
Objective-C:
// 設(shè)置屏幕常亮,默認(rèn)是NO
[UIApplication sharedApplication].idleTimerDisabled = YES;
// 設(shè)置窗口亮度大小,范圍是0.1 - 1.0
[UIScreen mainScreen] setBrightness: 0.5];
Swift:
UIApplication.shared.idleTimerDisabled = true