Skip to content

Instantly share code, notes, and snippets.

@TheFinestArtist
Created July 25, 2015 14:37
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/1bc3d7e3d10ab4e50dce to your computer and use it in GitHub Desktop.
Save TheFinestArtist/1bc3d7e3d10ab4e50dce to your computer and use it in GitHub Desktop.
MBProgressHUD+Custom
//
// MBProgressHUD+Custom.h
//
// Created by TheFinestArtist
//
#import <MBProgressHUD/MBProgressHUD.h>
@interface MBProgressHUD (Custom)
+ (void)showWithMessage:(NSString *)message toView:(UIView *)view;
+ (void)hideForView:(UIView *)view;
@end
//
// MBProgressHUD+Custom.m
//
// Created by TheFinestArtist
//
#import "MBProgressHUD+Custom.h"
#import "UIColor+Custom.h"
@implementation MBProgressHUD (Custom)
#pragma Hud Methods
+ (void)showWithMessage:(NSString *)message toView:(UIView *)view {
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
hud.color = [UIColor navy:0.7];
hud.labelText = NSLocalizedString(@"Loading", nil);
hud.detailsLabelText = message;
hud.yOffset = -40.0f;
}
+ (void)hideForView:(UIView *)view {
[MBProgressHUD hideAllHUDsForView:view animated:YES];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment