Latest 0.1.1
Homepage https://github.com/LeoMobileDeveloper/LHProgressHUD
License MIT
Platforms ios 8.0
Authors

Build StatusLicense: MIT Version

GIf

LHProgressHUD

Requirements

  • iOS 8+
  • ARC

Installation

LHProgressHUD is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "LHProgressHUD"

Basic Usage

If you have used MBProgressHUD before,it will be easy to use these API.

Show HUD and add it as a subview,then hide it

    LHProgressHUD * hud = [LHProgressHUD showSuccessAddedToView:self.view animated:YES];
    hud.textLabel.text = @"Loading...";
    [hud hideAfterDelay:1.0 hiddenBlock:^{
        NSLog(@"HUD is hidden");
    }];

LHProgressHUD have four basic sub state

  • Animating
  • Success
  • Failure
  • Info

You can use these function to switch between sub state

-(void)resetWithStatus:(NSString *)status;

-(void)showInfoWithStatus:(NSString *)status animated:(BOOL)animated;

-(void)showSuccessWithStatus:(NSString *)status animated:(BOOL)animated;

-(void)showFailureWithStatus:(NSString *)status animated:(BOOL)animated;

Pure Text

LHProgressHUD

LHProgressHUD * hud = [LHProgressHUD showAddedToView:self.view];
hud.mode = LHProgressHUDModeTextOnly;
hud.textLabel.text = @"Loading...";
[hud hideAfterDelay:1.0];

Activity Indicator

LHProgressHUD

LHProgressHUD * hud = [LHProgressHUD showAddedToView:self.view];
hud.mode = LHProgressHUDModeActivityIdenticator;
[hud hideAfterDelay:1.0];

Full Screen blur

LHProgressHUD

LHProgressHUD * hud = [LHProgressHUD showAddedToView:self.view];
hud.textLabel.text = @"Loading...";
hud.spinnerColor = [UIColor whiteColor];
hud.infoColor = [UIColor orangeColor];
hud.backgroundView.blurStyle = LHBlurEffectStyleDark;
hud.centerBackgroundView.blurStyle = LHBlurEffectStyleNone;
hud.centerBackgroundView.backgroundColor = [UIColor clearColor];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
    [hud showSuccessWithStatus:@"Success" animated:YES];
    [hud hideAfterDelay:1.0 hiddenBlock:^{
        NSLog(@"HUD is hidden");
    }];
});

GIf

LHProgressHUD * hud = [LHProgressHUD showAddedToView:self.view];
hud.mode = LHPRogressHUDModeGif;
hud.centerBackgroundView.blurStyle = LHBlurEffectStyleNone;
hud.centerBackgroundView.backgroundColor = [UIColor clearColor];
hud.gifImageView = [[LHGifImageView alloc] initWithGifImageName:@"gif"];
[hud hideAfterDelay:3.0];

You can get more deail by running the Example project

中文

如果你懂中文,可以在我的博客上看到中文文档

Author

Leo, [email protected]

License

LHProgressHUD is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "LHProgressHUD",
    "version": "0.1.1",
    "summary": "A modern ProgressHUD with wonderful animation and built-in blur and gif support",
    "description": "A modern ProgressHUD with wonderful animation and built-in blur and gif support for iOS 8.0+",
    "homepage": "https://github.com/LeoMobileDeveloper/LHProgressHUD",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "LeoMobileDeveloper": "[email protected]"
    },
    "source": {
        "git": "https://github.com/LeoMobileDeveloper/LHProgressHUD.git",
        "tag": "0.1.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "LHProgressHUD/Classes/**/*"
}

Pin It on Pinterest

Share This