KMResourceDownload.h 932 B

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // KMResourceDownload.h
  3. // PDF Master DMG
  4. //
  5. // Created by wanjun on 2023/8/1.
  6. //
  7. #import <Foundation/Foundation.h>
  8. NS_ASSUME_NONNULL_BEGIN
  9. typedef NS_ENUM(NSUInteger, KMResourceDownloadState) {
  10. KMResourceDownloadStateNone,
  11. KMResourceDownloadStateSuccess,
  12. KMResourceDownloadStateUnzipFailed,
  13. KMResourceDownloadStateMoveFailed
  14. };
  15. typedef void(^KMResourceDownloadResult)(BOOL isSuccessful, KMResourceDownloadState state);
  16. typedef void(^KMResourceDownloadProgress)(double progress);
  17. @interface KMResourceDownload : NSObject
  18. + (KMResourceDownload *)manager;
  19. @property(nonatomic, copy) KMResourceDownloadResult downloadResultBlock;
  20. @property(nonatomic, copy) KMResourceDownloadProgress progressBlock;
  21. - (void)downloadFrameworkProgress:(KMResourceDownloadProgress)currentProgress result:(KMResourceDownloadResult)result;
  22. - (BOOL)documentAIBundleIsExist;
  23. - (void)cancelDownload;
  24. @end
  25. NS_ASSUME_NONNULL_END