Skip to content

Instantly share code, notes, and snippets.

@jagbolanos
Created February 9, 2012 23:28
Show Gist options
  • Select an option

  • Save jagbolanos/1784229 to your computer and use it in GitHub Desktop.

Select an option

Save jagbolanos/1784229 to your computer and use it in GitHub Desktop.
Background Task and then Timer
UIBackgroundTaskIdentifier bgTask;
bgTask = [app beginBackgroundTaskWithExpirationHandler:^{
[app endBackgroundTask:bgTask];
}];
self.updateLocationTimer = [NSTimer scheduledTimerWithTimeInterval:UPDATE_INTERVAL target:self selector:@selector(shouldStartLocationUpdate) userInfo:nil repeats:YES];
@User2004

User2004 commented Jan 8, 2019

Copy link
Copy Markdown

Click here for work Timer in background in swift 3 or later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment