Skip to content

Latest commit

 

History

History
48 lines (32 loc) · 1.87 KB

File metadata and controls

48 lines (32 loc) · 1.87 KB

SVProgressHUD

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
  • talks with setNetworkActivityIndicatorVisible (can be disabled)

Installation

  • 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.

Usage

(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 networkIndicator:(BOOL)b;
+ (void)showInView:(UIView*)view status:(NSString*)string networkIndicator:(BOOL)b posY:(CGFloat)posY;

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;