-
-
Save matej/51201edcc84853e88c7c to your computer and use it in GitHub Desktop.
MBProgressHUD static
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
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]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment