secret
Created

MBProgressHUD static

  • Download Gist
gistfile1.m
Objective-C
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
static MBProgressHUD *__hud = nil;
 
+ (MBProgressHUD *)showGlobalProgressHUDWithTitle:(NSString *)title {
UIWindow *window = [[[UIApplication sharedApplication] windows] lastObject];
if (!__hud) {
__hud = [[MBProgressHUD alloc] initWithView:window];
}
__hud.labelText = title;
[window addSubview:__hud];
[__hud show:animated];
return hud;
}
 
+ (void)dismissGlobalHUD {
hud.removeFromSuperViewOnHide = YES;
[hud hide:animated];
[MBProgressHUD hideHUDForView:window animated:YES];
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.