BugFix: Tap on clock status bar should scroll you up

https://github.com/vector-im/vector-ios/issues/289
https://github.com/vector-im/vector-ios/issues/125
This commit is contained in:
giomfo
2016-05-19 17:22:29 +02:00
parent 8f31f0a14f
commit c9eee9ff4e
8 changed files with 134 additions and 23 deletions
@@ -30,10 +30,15 @@
#import "RageShakeManager.h"
#import "AppDelegate.h"
@interface RoomSearchViewController ()
{
// The event selected in the search results
MXEvent *selectedEvent;
// Observe kAppDelegateDidTapStatusBarNotification to handle tap on clock status bar.
id kAppDelegateDidTapStatusBarNotificationObserver;
}
@end
@@ -69,6 +74,24 @@
{
[self showSearch:animated];
}
// Observe kAppDelegateDidTapStatusBarNotificationObserver.
kAppDelegateDidTapStatusBarNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kAppDelegateDidTapStatusBarNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
[self.searchTableView setContentOffset:CGPointMake(-self.searchTableView.contentInset.left, -self.searchTableView.contentInset.top) animated:YES];
}];
}
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
if (kAppDelegateDidTapStatusBarNotificationObserver)
{
[[NSNotificationCenter defaultCenter] removeObserver:kAppDelegateDidTapStatusBarNotificationObserver];
kAppDelegateDidTapStatusBarNotificationObserver = nil;
}
}
#pragma mark - Override MXKViewController