17 #import <Foundation/Foundation.h>
18 #import <UIKit/UIKit.h>
20 #import "NIPreprocessorMacros.h"
24 typedef void (^NIOperationBlock)(
NIOperation* operation);
25 typedef void (^NIOperationDidFailBlock)(
NIOperation* operation, NSError* error);
53 @property (weak) id<NIOperationDelegate>
delegate;
54 @property (readonly, strong) NSError* lastError;
55 @property (assign) NSInteger
tag;
64 - (void)didFailWithError:(NSError *)error;
80 - (void)nimbusOperationDidStart:(
NIOperation *)operation;
89 - (void)nimbusOperationWillFinish:(
NIOperation *)operation;
96 - (void)nimbusOperationDidFinish:(
NIOperation *)operation;
103 - (void)nimbusOperationDidFail:(
NIOperation *)operation withError:(NSError *)error;
NIOperationDidFailBlock didFailWithErrorBlock
The operation failed in some way and has completed.
void willFinish()
In the operation's thread, notify the delegate that the operation will finish successfully.
The delegate protocol for an NIOperation.
NSInteger tag
A simple tagging mechanism for identifying operations.
NIOperationBlock didStartBlock
The operation has started executing.
void didFinish()
On the main thread, notify the delegate that the operation has finished.
NIOperationBlock willFinishBlock
The operation is about to complete successfully.
A base implementation of an NSOperation that supports traditional delegation and blocks.
id< NIOperationDelegate > delegate
The delegate through which changes are notified for this operation.
void didStart()
On the main thread, notify the delegate that the operation has begun.
NIOperationBlock didFinishBlock
The operation has completed successfully.