-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathSKListItemsController.m
50 lines (42 loc) · 1.71 KB
/
SKListItemsController.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
46
47
48
49
50
#import "SKListItemsController.h"
#import "common.h"
@implementation SKListItemsController
- (void)viewWillAppear:(BOOL)animated {
if ([self respondsToSelector:@selector(tintColor)])
{
self.view.tintColor = self.tintColor;
[[UIApplication sharedApplication] keyWindow].tintColor = self.tintColor;
}
if ([self respondsToSelector:@selector(navigationTintColor)])
{
self.navigationController.navigationBar.tintColor = self.navigationTintColor;
[[UIApplication sharedApplication] keyWindow].tintColor = self.navigationTintColor;
}
else
{
if ([self respondsToSelector:@selector(tintColor)])
{
self.navigationController.navigationBar.tintColor = self.tintColor;
}
}
BOOL tintNavText = YES;
if ([self respondsToSelector:@selector(tintNavigationTitleText)])
tintNavText = self.tintNavigationTitleText;
if (tintNavText)
{
if ([self respondsToSelector:@selector(navigationTitleTintColor)])
self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: self. navigationTitleTintColor };
else
if ([self respondsToSelector:@selector(tintColor)])
self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: self.tintColor };
}
[super viewWillAppear:animated];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[[UIApplication sharedApplication] keyWindow].tintColor = nil;
self.view.tintColor = nil;
self.navigationController.navigationBar.tintColor = nil;
self.navigationController.navigationBar.titleTextAttributes = @{};
}
@end