summaryrefslogtreecommitdiff
path: root/Juick/ViewControllers
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/ViewControllers')
-rw-r--r--Juick/ViewControllers/JuickNavigationController.m10
1 files changed, 10 insertions, 0 deletions
diff --git a/Juick/ViewControllers/JuickNavigationController.m b/Juick/ViewControllers/JuickNavigationController.m
index d79206c..66ad042 100644
--- a/Juick/ViewControllers/JuickNavigationController.m
+++ b/Juick/ViewControllers/JuickNavigationController.m
@@ -19,6 +19,8 @@
@property(nonatomic, strong) UIButton *avatarButton;
+-(void) applicationActivated;
+
@end
@implementation JuickNavigationController
@@ -52,6 +54,7 @@
[super viewDidLoad];
[self refreshStatus];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(userDidSignedIn:) name:UserChangedNotificationName object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationActivated) name:UIApplicationDidBecomeActiveNotification object:nil];
}
- (void)userDidSignedIn:(NSNotification *) notification {
@@ -104,4 +107,11 @@
- (IBAction)showLoginForm:(id)sender {
[self performSegueWithIdentifier:@"loginSegue" sender:self];
}
+- (void)applicationActivated {
+ [self refreshStatus];
+}
+- (void)dealloc
+{
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidBecomeActiveNotification object:nil];
+}
@end