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
@@ -96,6 +96,9 @@
NSInteger userSettingsPhoneNumberIndex;
NSInteger userSettingsNightModeSepIndex;
NSInteger userSettingsNightModeIndex;
// Observe kAppDelegateDidTapStatusBarNotification to handle tap on clock status bar.
id kAppDelegateDidTapStatusBarNotificationObserver;
}
/**
@@ -244,6 +247,13 @@
// Refresh linked emails in parallel
[self loadLinkedEmails];
// Observe kAppDelegateDidTapStatusBarNotificationObserver.
kAppDelegateDidTapStatusBarNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kAppDelegateDidTapStatusBarNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
[self.tableView setContentOffset:CGPointMake(-self.tableView.contentInset.left, -self.tableView.contentInset.top) animated:YES];
}];
}
- (void)viewWillDisappear:(BOOL)animated
@@ -274,6 +284,11 @@
notificationCenterDidFailObserver = nil;
}
if (kAppDelegateDidTapStatusBarNotificationObserver)
{
[[NSNotificationCenter defaultCenter] removeObserver:kAppDelegateDidTapStatusBarNotificationObserver];
kAppDelegateDidTapStatusBarNotificationObserver = nil;
}
}
#pragma mark - Internal methods