SVProgressHUD
Making address:Github.com/TransitApp/…
SVProgressHUD is similar to MBProgressHUD in that no protocol is required and no instance is required. It can be called directly from the class method:[SVProgressHUD method]
[SVProgressHUD dismiss]
# Basic approach
+ (void)show; + (void)showWithMaskType:(SVProgressHUDMaskType)maskType; + (void)showWithStatus:(NSString*)status; + (void)showWithStatus:(NSString*)status maskType:(SVProgressHUDMaskType)maskType; + (void)showProgress:(float)progress; + (void)showProgress:(float)progress maskType:(SVProgressHUDMaskType)maskType; + (void)showProgress:(float)progress status:(NSString*)status; + (void)showProgress:(float)progress status:(NSString*)status maskType:(SVProgressHUDMaskType)maskType; + (void)setStatus:(NSString*)string; // Stop the activity indicator, shows a glyph + status, and dismisses HUD a little bit later + (void)showInfoWithStatus:(NSString *)string; + (void)showInfoWithStatus:(NSString *)string maskType:(SVProgressHUDMaskType)maskType; + (void)showSuccessWithStatus:(NSString*)string; + (void)showSuccessWithStatus:(NSString*)string maskType:(SVProgressHUDMaskType)maskType; + (void)showErrorWithStatus:(NSString *)string; + (void)showErrorWithStatus:(NSString *)string maskType:(SVProgressHUDMaskType)maskType; // use 28x28 white pngs + (void)showImage:(UIImage*)image status:(NSString*)status; 28 * 28 px + (void)showImage:(UIImage*)image status:(NSString*)status maskType:(SVProgressHUDMaskType)maskType; + (void)setOffsetFromCenter:(UIOffset)offset; + (void)resetOffsetFromCenter; // Return center + (void)popActivity; // Eliminate a HUD, depending on its implementation method if the show method has been executed several times before, which makes one argument +1 if the given progress ==0 or pregress < 0, which makes that argument -1, and if the argument ==0, which executes the dismiss method. + (void)dismiss; Disappear + isVisible (BOOL); Is it showingCopy the code
Configuration of HUD properties
+ (void)setBackgroundColor:(UIColor*)color; Default is [UIColor whiteColor] + (void)setForegroundColor:(UIColor*)color; // default is [UIColor blackColor] + (void)setRingThickness:(CGFloat)width; //progress width // default is 4 pt + (void)setFont:(UIFont*)font; / / font / / default is [UIFont preferredFontForTextStyle: UIFontTextStyleSubheadline] + (void) setInfoImage: UIImage *) image; // default is the bundled info image provided by Freepik + (void)setSuccessImage:(UIImage*)image; // default is the bundled success image provided by Freepik + (void)setErrorImage:(UIImage*)image; // Default is the bundled error image provided by Freepik + (void)setDefaultMaskType:(SVProgressHUDMaskType)maskType; // When the HUD displays, Whether the user can click on other controls / / default is SVProgressHUDMaskTypeNone SVProgressHUDMaskTypeNone = 1, / / allow the user to other user operations SVProgressHUDMaskTypeClear, / / do not allow the user to other user actions SVProgressHUDMaskTypeBlack, / / do not allow the user to other user actions, And the background is black SVProgressHUDMaskTypeGradient / / allow the user to other user actions, and the background is gradient black + (void) setViewForExtension (UIView *) view; #define SV_APP_EXTENSIONS = #define SV_APP_EXTENSIONSCopy the code
Notification about HUD
extern NSString * const SVProgressHUDDidReceiveTouchEventNotification; / / click outside the HUD extern nsstrings * const SVProgressHUDDidTouchDownInsideNotification; / / click in the HUD extern nsstrings * const SVProgressHUDWillDisappearNotification; / / to be displayed extern nsstrings * const SVProgressHUDDidDisappearNotification; / / have shown extern nsstrings * const SVProgressHUDWillAppearNotification; / / will disappear extern nsstrings * const SVProgressHUDDidAppearNotification; / / have disappeared extern nsstrings * const SVProgressHUDStatusUserInfoKey; / / the state of the HUDCopy the code
Stored in the userInfo dictionary in the notice of the HUD, its key is SVProgressHUDStatusUserInfoKey
Arrange the:
SVProgressHUD – use
IOS HUD(Transparent Indicator layer)