|
@@ -9,8 +9,6 @@
|
9
|
9
|
@implementation TopBarAppearancePresenter {
|
10
|
10
|
UINavigationBarAppearance* _appearance;
|
11
|
11
|
}
|
12
|
|
-@synthesize backgroundColor = _backgroundColor;
|
13
|
|
-@synthesize translucent = _translucent;
|
14
|
12
|
|
15
|
13
|
- (instancetype)initWithNavigationController:(UINavigationController *)boundNavigationController {
|
16
|
14
|
self = [super initWithNavigationController:boundNavigationController];
|
|
@@ -20,7 +18,7 @@
|
20
|
18
|
}
|
21
|
19
|
|
22
|
20
|
- (void)setTranslucent:(BOOL)translucent {
|
23
|
|
- _translucent = translucent;
|
|
21
|
+ [super setTranslucent:translucent];
|
24
|
22
|
[self updateBackgroundAppearance];
|
25
|
23
|
}
|
26
|
24
|
|
|
@@ -28,17 +26,12 @@
|
28
|
26
|
[self updateBackgroundAppearance];
|
29
|
27
|
}
|
30
|
28
|
|
31
|
|
-- (void)setBackgroundColor:(UIColor *)backgroundColor {
|
32
|
|
- _backgroundColor = backgroundColor;
|
33
|
|
- [self updateBackgroundAppearance];
|
34
|
|
-}
|
35
|
|
-
|
36
|
29
|
- (void)updateBackgroundAppearance {
|
37
|
30
|
if (self.transparent) {
|
38
|
31
|
[_appearance configureWithTransparentBackground];
|
39
|
|
- } else if (_backgroundColor) {
|
40
|
|
- [_appearance setBackgroundColor:_backgroundColor];
|
41
|
|
- } else if (_translucent) {
|
|
32
|
+ } else if (self.backgroundColor) {
|
|
33
|
+ [_appearance setBackgroundColor:self.backgroundColor];
|
|
34
|
+ } else if (self.translucent) {
|
42
|
35
|
[_appearance configureWithDefaultBackground];
|
43
|
36
|
} else {
|
44
|
37
|
[_appearance configureWithOpaqueBackground];
|