Skip to content

Instantly share code, notes, and snippets.

@mustafaibrahim989
Created November 4, 2014 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mustafaibrahim989/84e0b68bc11c657fc3e1 to your computer and use it in GitHub Desktop.
Save mustafaibrahim989/84e0b68bc11c657fc3e1 to your computer and use it in GitHub Desktop.
//
// 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
//
// 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