MBProgressHUD+Extension.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // MBProgressHUD+Extension.h
  3. // Starbuds
  4. //
  5. // Created by 翟玉磊 on 2020/1/17.
  6. // Copyright © 2020 翟玉磊. All rights reserved.
  7. //
  8. #import "MBProgressHUD.h"
  9. // 统一的显示时长
  10. #define kHudShowTime 1.5
  11. NS_ASSUME_NONNULL_BEGIN
  12. @interface MBProgressHUD (Extension)
  13. #pragma mark 在指定的view上显示hud
  14. + (void)showMessage:(NSString *)message toView:(UIView * _Nullable)view;
  15. + (void)showSuccess:(NSString *)success toView:(UIView * _Nullable)view;
  16. + (void)showError:(NSString *)error toView:(UIView * _Nullable)view;
  17. + (void)showWarning:(NSString *)Warning toView:(UIView * _Nullable)view;
  18. + (void)showMessageWithImageName:(NSString * _Nullable)imageName message:(NSString *)message toView:(UIView * _Nullable)view;
  19. + (MBProgressHUD *)showActivityMessage:(NSString*)message view:(UIView * _Nullable)view;
  20. + (MBProgressHUD *)showProgressBarToView:(UIView * _Nullable)view;
  21. #pragma mark 在window上显示hud
  22. + (void)showMessage:(NSString *)message;
  23. + (void)showSuccess:(NSString *)success;
  24. + (void)showError:(NSString *)error;
  25. + (void)showWarning:(NSString *)Warning;
  26. + (void)showMessageWithImageName:(NSString * _Nullable)imageName message:(NSString *)message;
  27. + (MBProgressHUD *)showActivityMessage:(NSString*)message;
  28. #pragma mark 移除hud
  29. + (void)hideHUDForView:(UIView * _Nullable)view;
  30. + (void)hideHUD;
  31. @end
  32. NS_ASSUME_NONNULL_END