2
0

SDAsyncBlockOperation.h 724 B

123456789101112131415161718192021
  1. /*
  2. * This file is part of the SDWebImage package.
  3. * (c) Olivier Poitrey <rs@dailymotion.com>
  4. *
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. */
  8. #import "SDWebImageCompat.h"
  9. @class SDAsyncBlockOperation;
  10. typedef void (^SDAsyncBlock)(SDAsyncBlockOperation * __nonnull asyncOperation);
  11. /// A async block operation, success after you call `completer` (not like `NSBlockOperation` which is for sync block, success on return)
  12. @interface SDAsyncBlockOperation : NSOperation
  13. - (nonnull instancetype)initWithBlock:(nonnull SDAsyncBlock)block;
  14. + (nonnull instancetype)blockOperationWithBlock:(nonnull SDAsyncBlock)block;
  15. - (void)complete;
  16. @end