TZImageRequestOperation.h 1.0 KB

123456789101112131415161718192021222324252627282930
  1. //
  2. // TZImageRequestOperation.h
  3. // TZImagePickerControllerFramework
  4. //
  5. // Created by 谭真 on 2018/12/20.
  6. // Copyright © 2018 谭真. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <Photos/Photos.h>
  10. NS_ASSUME_NONNULL_BEGIN
  11. @interface TZImageRequestOperation : NSOperation
  12. typedef void(^TZImageRequestCompletedBlock)(UIImage *photo, NSDictionary *info, BOOL isDegraded);
  13. typedef void(^TZImageRequestProgressBlock)(double progress, NSError *error, BOOL *stop, NSDictionary *info);
  14. @property (nonatomic, copy, nullable) TZImageRequestCompletedBlock completedBlock;
  15. @property (nonatomic, copy, nullable) TZImageRequestProgressBlock progressBlock;
  16. @property (nonatomic, strong, nullable) PHAsset *asset;
  17. @property (assign, nonatomic, getter = isExecuting) BOOL executing;
  18. @property (assign, nonatomic, getter = isFinished) BOOL finished;
  19. - (instancetype)initWithAsset:(PHAsset *)asset completion:(TZImageRequestCompletedBlock)completionBlock progressHandler:(TZImageRequestProgressBlock)progressHandler;
  20. - (void)done;
  21. @end
  22. NS_ASSUME_NONNULL_END