-
Notifications
You must be signed in to change notification settings - Fork 1
/
JPHAsyncOperation.h
34 lines (23 loc) · 1.09 KB
/
JPHAsyncOperation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// JPHAsyncOperation.h
// JPHAsyncOperation
//
// Created by Pierre Houston on 2015-06-19.
// Copyright © 2015 Pierre Houston. All rights reserved.
//
@import Foundation;
@class JPHAsyncOperation;
typedef void (^JPHAsyncOperationBlock)(JPHAsyncOperation *op);
@interface JPHAsyncOperation : NSOperation
+ (instancetype)operationWithBlock:(JPHAsyncOperationBlock)block;
+ (instancetype)operationWithStartBlock:(JPHAsyncOperationBlock)startBlock cancelBlock:(JPHAsyncOperationBlock)cancelBlock;
- (instancetype)initWithBlock:(JPHAsyncOperationBlock)block;
- (instancetype)initWithStartBlock:(JPHAsyncOperationBlock)startBlock cancelBlock:(JPHAsyncOperationBlock)cancelBlock;
- (void)finish;
@end
// yes, deliberately import this category header after the declarations above
// it depends on JPHAsyncOpBlock to be defined but when imported by this file,
// its own import of this same header is of course short-circuited.
// could instead have JPHAsyncOperation/JPHAsyncOperation.h be an umbrealla header
// which includes this and then the category header.
#import "NSOperationQueue+JPHAsync.h"