Disable the timer idle timer using something like this.
[self performSelector:@selector(enableIdleTimer) withObject:nil afterDelay:4]; - (void)enableIdleTimer { [[UIApplication sharedApplication] setIdleTimerDisabled:NO]; }
Alternatively, this is a more modern and simple approach:
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(4 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [[UIApplication sharedApplication] setIdleTimerDisabled:NO]; });
source share