Created
July 25, 2015 14:19
-
-
Save TheFinestArtist/6581d012544d19e557e9 to your computer and use it in GitHub Desktop.
JGProgressHUD+Custom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// JGProgressHUD+Custom.h | |
// Custom | |
// | |
// Created by The Finest Artist | |
// | |
// | |
#import <JGProgressHUD/JGProgressHUD.h> | |
@interface JGProgressHUD (Custom) | |
+ (JGProgressHUD *)showWithMessage:(NSString *)message view:(UIView *)view; | |
+ (void)hideAllHUDInView:(UIView *)view; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// JGProgressHUD+Custom.m | |
// Custom | |
// | |
// Created by The Finest Artist | |
// | |
// | |
#import "JGProgressHUD+Custom.h" | |
@implementation JGProgressHUD (Custom) | |
#pragma Hud Methods | |
+ (JGProgressHUD *)showWithMessage:(NSString *)message view:(UIView *)view { | |
JGProgressHUD *HUD = [JGProgressHUD progressHUDWithStyle:JGProgressHUDStyleExtraLight]; | |
HUD.textLabel.text = message; | |
HUD.textLabel.textColor = UIColorFromRGB(kColorGray); | |
HUD.textLabel.font = [UIFont systemFontOfSize:15.f]; | |
JGProgressHUDIndeterminateIndicatorView *indicatorView = [[JGProgressHUDIndeterminateIndicatorView alloc] initWithHUDStyle:JGProgressHUDStyleExtraLight]; | |
[indicatorView setColor:UIColorFromRGB(kColorOrange)]; | |
HUD.indicatorView = indicatorView; | |
HUD.marginInsets = UIEdgeInsetsMake(0, 0, view.bounds.size.height / 30.f, 0); | |
[HUD showInView:view animated:YES]; | |
return HUD; | |
} | |
+ (void)hideAllHUDInView:(UIView *)view { | |
for (JGProgressHUD *HUD in [JGProgressHUD allProgressHUDsInView:view]) | |
[HUD dismissAnimated:YES]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment