SVProgressHUD is a clean, lightweight and unobstruptive progress HUD for iOS. It’s a simplified and prettyfied alternative to the popular MBProgressHUD. Its fade in/out animations are highly inspired on Lauren Britcher’s HUD in Tweetie for iOS. The success and error icons are from Glyphish.
SVProgressHUD features:
- very simple singleton convenience methods
- optional loading, success and error status messages
- automatic centering based on device type, orientation, and optional
posY
parameter - automatic masking any touch operations, ana optional
mask
parameter
- Drag the
SVProgressHUD/SVProgressHUD
folder into your project. - Add the QuartzCore framework to your project.
If you plan on using SVProgressHUD in a lot of places inside your app, I recommend importing it directly inside your prefix file.
(see sample Xcode project in /Sample
)
SVProgressHUD is created as a singleton (i.e. it doesn’t need to be explictely allocated and instantiated) and can be shown with the following class methods, depending on the customization level you need to achieve:
+ (void)show; + (void)showInView:(UIView*)view; + (void)showInView:(UIView*)view status:(NSString*)string; + (void)showInView:(UIView*)view status:(NSString*)string mask:(BOOL)b; + (void)showInView:(UIView*)view status:(NSString*)string posY:(CGFloat)posY mask:(BOOL)b;
You dismiss it using one of these:
+ (void)dismiss; + (void)dismissWithSuccess:(NSString*)successString; + (void)dismissWithError:(NSString*)errorString;
If you’re using SVProgressHUD to show the status of a many-steps operation, you can also change the HUD status while it’s showing with:
+ (void)setStatus:(NSString*)string;