Last active
August 29, 2015 14:25
-
-
Save maximbilan/d081d7058ef0c5b06d27 to your computer and use it in GitHub Desktop.
iOS: idleTimerDisabled = YES works until UIImagePickerController was used
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
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { | |
[self dismissViewControllerAnimated:YES completion:^{ | |
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | |
[UIApplication sharedApplication].idleTimerDisabled = YES; | |
}); | |
}]; | |
} | |
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { | |
self dismissViewControllerAnimated:YES completion:^{ | |
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | |
[UIApplication sharedApplication].idleTimerDisabled = YES; | |
}); | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment