Skip to content

Instantly share code, notes, and snippets.

@TheFinestArtist
Created July 25, 2015 14:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheFinestArtist/6581d012544d19e557e9 to your computer and use it in GitHub Desktop.
Save TheFinestArtist/6581d012544d19e557e9 to your computer and use it in GitHub Desktop.
JGProgressHUD+Custom
//
// 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
//
// 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