Based on this post: http://hayageek.com/ios-long-running-background-task/
[![CI Status](http://img.shields.io/travis/Jason Ardell/BackgroundTask.svg?style=flat)](https://travis-ci.org/Jason Ardell/BackgroundTask)
To periodically run a task in the background:
#import <BackgroundTask/BGTBackgroundTask.h>
BGTBackgroundTask *bgTask = [[BGTBackgroundTask alloc] init];
[bgTask startBackgroundTasks:600 // every 600 seconds
target:self // run [self doWork]
selector:@selector(doWork)];
None.
BackgroundTask is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'BackgroundTask', git: 'https://github.com/ardell/BackgroundTask.git'
You'll also need to edit the UIBackgroundModes setting in your [project]-Info.plist file to include the following lines (to enable background processing)...
<string>voip</string>
<string>audio</string>
Jason Ardell, ardell@gmail.com
BackgroundTask is available under the MIT license. See the LICENSE file for more info.