summaryrefslogtreecommitdiff
path: root/Juick/ViewControllers/ChatViewController.m
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-10-31 00:40:51 +0300
committerGravatar Vitaly Takmazov2018-10-31 00:40:51 +0300
commitd5ffc51c8d1721e53d92dd919a36c72b43d05c45 (patch)
tree79fd594505c0936d317f1bbaf853248ca3d24dc4 /Juick/ViewControllers/ChatViewController.m
parent2d6630dda9f7c3df0da956c4644f94342d2bb747 (diff)
Refresh chat on uname change
Diffstat (limited to 'Juick/ViewControllers/ChatViewController.m')
-rw-r--r--Juick/ViewControllers/ChatViewController.m5
1 files changed, 5 insertions, 0 deletions
diff --git a/Juick/ViewControllers/ChatViewController.m b/Juick/ViewControllers/ChatViewController.m
index c36bf1a..54614b7 100644
--- a/Juick/ViewControllers/ChatViewController.m
+++ b/Juick/ViewControllers/ChatViewController.m
@@ -31,6 +31,7 @@
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChangeFrame:) name:UIKeyboardWillChangeFrameNotification object:nil];
self.refreshControl = [UIRefreshControl new];
[self.refreshControl addTarget:self action:@selector(reloadChat) forControlEvents:UIControlEventValueChanged];
+ [self addObserver:self forKeyPath:@"uname" options:0 context:nil];
}
-(void) reloadChat {
@@ -109,4 +110,8 @@
}];
}
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context {
+ [self reloadChat];
+}
+
@end