SVProgressHUD.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // SVProgressHUD.h
  3. //
  4. // Created by Sam Vermette on 27.03.11.
  5. // Copyright 2011 Sam Vermette. All rights reserved.
  6. //
  7. // https://github.com/samvermette/SVProgressHUD
  8. //
  9. #import <UIKit/UIKit.h>
  10. #import <AvailabilityMacros.h>
  11. enum {
  12. SVProgressHUDMaskTypeNone = 1, // allow user interactions while HUD is displayed
  13. SVProgressHUDMaskTypeClear, // don't allow
  14. SVProgressHUDMaskTypeBlack, // don't allow and dim the UI in the back of the HUD
  15. SVProgressHUDMaskTypeGradient // don't allow and dim the UI with a a-la-alert-view bg gradient
  16. };
  17. typedef NSUInteger SVProgressHUDMaskType;
  18. @interface SVProgressHUD : UIView
  19. + (void)show;
  20. + (void)showWithStatus:(NSString*)status;
  21. + (void)showWithStatus:(NSString*)status maskType:(SVProgressHUDMaskType)maskType;
  22. + (void)showWithMaskType:(SVProgressHUDMaskType)maskType;
  23. + (void)showSuccessWithStatus:(NSString*)string;
  24. + (void)showSuccessWithStatus:(NSString *)string duration:(NSTimeInterval)duration;
  25. + (void)showErrorWithStatus:(NSString *)string;
  26. + (void)showErrorWithStatus:(NSString *)string duration:(NSTimeInterval)duration;
  27. + (void)setStatus:(NSString*)string; // change the HUD loading status while it's showing
  28. + (void)dismiss; // simply dismiss the HUD with a fade+scale out animation
  29. + (void)dismissWithSuccess:(NSString*)successString; // also displays the success icon image
  30. + (void)dismissWithSuccess:(NSString*)successString afterDelay:(NSTimeInterval)seconds;
  31. + (void)dismissWithError:(NSString*)errorString; // also displays the error icon image
  32. + (void)dismissWithError:(NSString*)errorString afterDelay:(NSTimeInterval)seconds;
  33. + (BOOL)isVisible;
  34. + (SVProgressHUD*)sharedView;
  35. @end