summaryrefslogtreecommitdiff
path: root/Juick/ViewControllers/JuickNavigationController.m
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/ViewControllers/JuickNavigationController.m')
-rw-r--r--Juick/ViewControllers/JuickNavigationController.m7
1 files changed, 7 insertions, 0 deletions
diff --git a/Juick/ViewControllers/JuickNavigationController.m b/Juick/ViewControllers/JuickNavigationController.m
index f535c82..d79206c 100644
--- a/Juick/ViewControllers/JuickNavigationController.m
+++ b/Juick/ViewControllers/JuickNavigationController.m
@@ -32,6 +32,13 @@
} else {
avatarUrl = user.avatar;
}
+ UIViewController *discussions = [self.viewControllers objectAtIndex:1];
+ if (user.unreadCount > 0) {
+ [discussions tabBarItem].badgeColor = [UIColor colorNamed:@"Funny"];
+ [discussions tabBarItem].badgeValue = [NSString stringWithFormat:@"%ld", user.unreadCount];
+ } else {
+ [discussions tabBarItem].badgeValue = nil;
+ }
[[AppDelegate shared].api fetchImageWithURL:[NSURL URLWithString:avatarUrl] callback:^(NSData *data) {
self.avatarButton = [UIButton buttonWithType:UIButtonTypeCustom];
[self.avatarButton addTarget:self action:@selector(showLoginForm:) forControlEvents:UIControlEventTouchUpInside];