prevent iphone to sleep swift code example Example: prevent iphone to sleep swift UIApplication.sharedApplication().idleTimerDisabled = true