Created
November 4, 2014 10:20
-
-
Save mustafaibrahim989/84e0b68bc11c657fc3e1 to your computer and use it in GitHub Desktop.
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
// | |
// MBProgressHUD+Extra.h | |
// EFG-IPhone | |
// | |
// Created by Mustafa Ibrahim on 10/23/14. | |
// Copyright (c) 2014 EFGHermes. All rights reserved. | |
// | |
#import "MBProgressHUD.h" | |
@interface MBProgressHUD (Extra) | |
+ (MB_INSTANCETYPE)showHUDAddedTo:(UIView *)view title:(NSString *) title animated:(BOOL)animated; | |
@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
// | |
// MBProgressHUD+Extra.m | |
// EFG-IPhone | |
// | |
// Created by Mustafa Ibrahim on 10/23/14. | |
// Copyright (c) 2014 EFGHermes. All rights reserved. | |
// | |
#import "MBProgressHUD+Extra.h" | |
#if __has_feature(objc_arc) | |
#define MB_AUTORELEASE(exp) exp | |
#define MB_RELEASE(exp) exp | |
#define MB_RETAIN(exp) exp | |
#else | |
#define MB_AUTORELEASE(exp) [exp autorelease] | |
#define MB_RELEASE(exp) [exp release] | |
#define MB_RETAIN(exp) [exp retain] | |
#endif | |
@implementation MBProgressHUD (Extra) | |
+ (MB_INSTANCETYPE)showHUDAddedTo:(UIView *)view title:(NSString *) title animated:(BOOL)animated { | |
MBProgressHUD *hud = [[self alloc] initWithView:view]; | |
hud.labelText = title; | |
[view addSubview:hud]; | |
[hud show:animated]; | |
return MB_AUTORELEASE(hud); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment