KSHudLoagingManager.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. //
  2. // KSHudLoagingManager.h
  3. // GuanYueTeam
  4. //
  5. // Created by 王智 on 2022/11/14.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import <MBProgressHUD/MBProgressHUD.h>
  9. #import "KSCustomLoadingView.h"
  10. #import "KSProgressLoadingView.h"
  11. typedef void(^KSLoadingCancel)(void);
  12. #define LOADING_MANAGER ([KSHudLoagingManager shareInstance])
  13. NS_ASSUME_NONNULL_BEGIN
  14. @interface KSHudLoagingManager : NSObject
  15. @property (nonatomic, strong) MBProgressHUD *HUD;
  16. @property (nonatomic, strong) KSCustomLoadingView *loadingView;
  17. @property (nonatomic, strong) KSProgressLoadingView *progressLoading;
  18. + (instancetype)shareInstance;
  19. - (void)showCustomLoading:(NSString *)text;
  20. - (void)showCancelCustomLoading:(NSString *)text cancel:(KSLoadingCancel)cancel;
  21. - (void)removeCustomLoading;
  22. - (void)showHUD;
  23. - (void)removeHUD;
  24. - (void)removeHUDNoDelay;
  25. - (void)MBPShow:(NSString*)str inView:(UIView *)displayView;
  26. - (void)MBShowAUTOHidingInWindow:(NSString *)str;
  27. - (void)MBShowInWindow:(NSString *)str;
  28. - (MBProgressHUD *)MBPShowLoadingHubWithText:(NSString *)text;
  29. // 提示后续操作
  30. - (void)KSShowMsg:(NSString *)message inView:(UIView *)displayView promptCompletion:(void(^)(void))promptCompletion;
  31. // 提示后续操作
  32. - (void)KSShowMsg:(NSString *)message promptCompletion:(void(^)(void))promptCompletion;
  33. /// 加载进度loading
  34. /// - Parameters:
  35. /// - text: 文本
  36. /// - progress: 进度比例 0~1
  37. - (void)showProgressLoading:(NSString *)text progress:(CGFloat)progress;
  38. /// 加载进度loading
  39. /// - Parameters:
  40. /// - text: 文本
  41. /// - progress: 进度比例 0~1
  42. - (void)showProgressNoAnimationLoading:(NSString *)text progress:(CGFloat)progress;
  43. /// 加载进度loading 完成后回调
  44. /// - Parameters:
  45. /// - text: 文本
  46. /// - progress: 进度比例 0~1
  47. /// - promptCompletion: 回调
  48. - (void)showProgressLoading:(NSString *)text progress:(CGFloat)progress promptCompletion:(void(^)(void))promptCompletion;
  49. /// 移除进度loading
  50. - (void)removeProgressLoading;
  51. // 进度loading后续操作
  52. - (void)KSShowProgressMsg:(NSString *)message promptCompletion:(void(^)(void))promptCompletion;
  53. @end
  54. NS_ASSUME_NONNULL_END