forked from BandarHL/BHTwitter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJGProgressHUDImageIndicatorView.m
42 lines (33 loc) · 1.01 KB
/
JGProgressHUDImageIndicatorView.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
//
// JGProgressHUDImageIndicatorView.m
// JGProgressHUD
//
// Created by Jonas Gessner on 05.08.15.
// Copyright (c) 2015 Jonas Gessner. All rights reserved.
//
#import "JGProgressHUDImageIndicatorView.h"
@implementation JGProgressHUDImageIndicatorView {
BOOL _customizedTintColor;
}
- (instancetype)initWithImage:(UIImage *)image {
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
self = [super initWithContentView:imageView];
return self;
}
- (void)setUpForHUDStyle:(JGProgressHUDStyle)style vibrancyEnabled:(BOOL)vibrancyEnabled {
[super setUpForHUDStyle:style vibrancyEnabled:vibrancyEnabled];
if (!_customizedTintColor) {
if (style == JGProgressHUDStyleDark) {
self.tintColor = [UIColor whiteColor];
}
else {
self.tintColor = [UIColor blackColor];
}
_customizedTintColor = NO;
}
}
- (void)setTintColor:(UIColor *)tintColor {
[super setTintColor:tintColor];
_customizedTintColor = YES;
}
@end