-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathCommonHelper.m
45 lines (35 loc) · 1.02 KB
/
CommonHelper.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// CommonHelper.m
// VideoEditDemo
//
// Created by mr.cao on 14-6-13.
// Copyright (c) 2014年 mrcao. All rights reserved.
//
#import "CommonHelper.h"
static CommonHelper *instance;
@implementation CommonHelper
+(CommonHelper *)sharedInstance
{
//if(instance==nil)
//{
// instance=[[CommonHelper alloc] init];
// }
static dispatch_once_t pred;
dispatch_once(&pred, ^{instance=[[self alloc]init];});
return instance;
}
-(MBProgressHUD *) showHud:(id<MBProgressHUDDelegate>) delegate title:(NSString *) title selector:(SEL) selector arg:(id) arg targetView:(UIView *)targetView
{
MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:targetView];
[targetView addSubview:hud];
hud.removeFromSuperViewOnHide = YES;
hud.delegate = delegate;
hud.labelText = title;
hud.mode=MBProgressHUDModeDeterminate;
[hud showWhileExecuting:selector
onTarget:delegate
withObject:arg
animated:YES];
return hud;
}
@end