ios程序 設置不黑屏 禁止黑屏


down vote accepted

Objective-C:

[[UIApplication sharedApplication] setIdleTimerDisabled: YES];

Swift:

UIApplication.sharedApplication().idleTimerDisabled = true

Swift 3:

UIApplication.shared.isIdleTimerDisabled = true

你可能感兴趣的:(iOS,Objective-C,iOS,xcode,Object-C)