NSOperationQueue+CompletionBlock 1.0.0

NSOperationQueue+CompletionBlock 1.0.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Jul 2015

Maintained by Suyeol Jeon.


Downloads

Total25,037
Week0
Month0

Installs

Apps108
Test Targets10
powered by Segment

GitHub

Stars9
Watchers0
Forks0
Issues0
Contributors1
Pull Requests0

Code

Files2
LOCLines of Code 63


  • By
  • devxoul

A missing completionBlock for NSOperationQueue.

At a Glance

Swift

import NSOperationQueue_CompletionBlock

let queue = NSOperationQueue()
queue.completionBlock = {
    NSLog("I'm done!")
}
queue.addOperationWithBlock {
    NSLog("I am an operation.")
}

Objective-C

#import <NSOperationQueue_CompletionBlock/NSOperationQueue+CompletionBlock.h>

NSOperationQueue *queue = [[NSOperationQueue alloc] init];
queue.completionBlock = ^{
    NSLog(@"I'm done!");
};
[queue addOperationWithBlock:^{
    NSLog(@"I am an operation.");
}];

Output

I am an operation.
I'm dont!

Installation

I recommend you to use CocoaPods, a dependency manager for Cocoa.

Podfile

pod 'NSOperationQueue+CompletionBlock', '~> 1.0'

License

NSOperationQueue+CompletionBlock is under MIT license. See the LICENSE file for more info.