Created
February 12, 2019 23:38
-
-
Save brentpicasso/488a78d8f558c223e1634226dd8f07b6 to your computer and use it in GitHub Desktop.
iOS keep sleep timer from enabling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Prevent sleep | |
[NSTimer scheduledTimerWithTimeInterval:2.0 repeats:YES block: ^(NSTimer * _Nonnull timer) { | |
[UIApplication sharedApplication].idleTimerDisabled = NO; | |
[UIApplication sharedApplication].idleTimerDisabled = YES; | |
NSLog(@"idle timer"); | |
}]; | |
NSLog(@"Initializing python"); | |
Py_Initialize(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment