Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
iOS keep sleep timer from enabling
// 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
You can’t perform that action at this time.