CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.
TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Wil Gieseler.
A drop-in replacement for NSBlockOperation that automatically configures itself as a background task. iOS only, obviously.
This is nice because you don't have to keep track of any pesky UIBackgroundTaskIdentifier or anything like that.
(pending) Add this line to your application's Podfile:
pod 'WGBackgroundBlockOperation'
Say you have a pretty simple long-running task:
[NSOperationQueue.mainQueue addOperation:[WGBackgroundBlockOperation blockOperationWithBlock:^{
[self someLongRunningTask];
}];
If your operation block spawns other operations, you might want to end the background task manually:
__block WGBackgroundBlockOperation *op = [WGBackgroundBlockOperation blockOperationWithBlock:^{
[self postAGiantImageToLetsSaySomeKindOfServerWithCompletionBlock:^{
[self completeUpload];
[op endBackgroundTask];
}];
}];
op.automaticallyEndsBackgroundTask = NO;
[NSOperationQueue.mainQueue addOperation:op];
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)