/NSOperationQueue-CompletionBlock

Completion block for NSOperationQueue.

Primary LanguageObjective-CMIT LicenseMIT

NSOperationQueue+CompletionBlock

Build Status CocoaPods

Completion block 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 done!

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.