XCHudHelper.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //
  2. // XCHudHelper.h
  3. //
  4. // Created by TopDev on 10/23/14.
  5. // Copyright (c) 2014 TopDev. All rights reserved.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import "MBProgressHUD.h"
  9. @interface XCHudHelper : NSObject
  10. @property(nonatomic, strong) MBProgressHUD *hud;
  11. // 单例
  12. + (XCHudHelper *)sharedInstance;
  13. // 在window上显示菊花转hud
  14. - (void)showHudAcitivityOnWindow;
  15. // 在window上显示hud
  16. // 参数:
  17. // caption:标题
  18. // bActive:是否显示转圈动画
  19. // time:自动消失时间,如果为0,则不自动消失
  20. - (void)showHudOnWindow:(NSString *)caption
  21. image:(UIImage *)image
  22. acitivity:(BOOL)bAcitve
  23. autoHideTime:(NSTimeInterval)time;
  24. // 在当前的view上显示hud
  25. // 参数:
  26. // view:要添加hud的view
  27. // caption:标题
  28. // image:图片
  29. // bActive:是否显示转圈动画
  30. // time:自动消失时间,如果为0,则不自动消失
  31. - (void)showHudOnView:(UIView *)view
  32. caption:(NSString *)caption
  33. image:(UIImage *)image
  34. acitivity:(BOOL)bAcitve
  35. autoHideTime:(NSTimeInterval)time;
  36. - (void)setCaption:(NSString *)caption;
  37. // 隐藏hud
  38. - (void)hideHud;
  39. - (void)hideHudAfter:(NSTimeInterval)time;
  40. //成功,失败,普通信息
  41. + (void)showSuccess:(NSString *)success;
  42. + (void)showError:(NSString *)error;
  43. + (void)showMessage:(NSString *)message;
  44. + (void)hideHUD;
  45. @end