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