-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxolawareProgressHUD.m
More file actions
39 lines (33 loc) · 945 Bytes
/
xolawareProgressHUD.m
File metadata and controls
39 lines (33 loc) · 945 Bytes
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
//
// xolawareProgressHUD.m
// athlete
//
// Created by me on 2012.11.26.
#include "xolawareOpenSourceCopyright.h" // Copyright (c) 2012 xolaware.
#import "xolawareProgressHUD.h"
@implementation xolawareProgressHUD
- (void)showNowAndHideAfterDuration:(NSTimeInterval)duration {
[self show:YES];
[self hide:YES afterDelay:duration];
}
- (void)showText:(NSString*)labelText
andSubText:(NSString*)subText
inView:(UIView*)superView
duration:(NSTimeInterval)duration
{
self.animationType = MBProgressHUDAnimationZoomOut;
self.mode = MBProgressHUDModeText;
self.labelText = NSLocalizedString(labelText, nil);
self.detailsLabelText = NSLocalizedString(subText, nil);
if ([NSThread isMainThread])
{
[superView addSubview:self];
[self showNowAndHideAfterDuration:duration];
}
else
dispatch_async(dispatch_get_main_queue(), ^{
[superView addSubview:self];
[self showNowAndHideAfterDuration:duration];
});
}
@end