Public rooms search: Automatically scroll to the top on each new seach

This commit is contained in:
manuroe
2015-12-21 11:13:46 +01:00
parent 68fd187509
commit 6ff5cadfee
4 changed files with 27 additions and 27 deletions
+2 -23
View File
@@ -32,9 +32,6 @@
@interface RecentsViewController ()
{
// Recents refresh handling
BOOL shouldScrollToTopOnRefresh;
// The "parent" segmented view controller
HomeViewController *homeViewController;
@@ -254,10 +251,10 @@
[self.recentsTableView reloadData];
if (shouldScrollToTopOnRefresh)
if (_shouldScrollToTopOnRefresh)
{
[self scrollToTop];
shouldScrollToTopOnRefresh = NO;
_shouldScrollToTopOnRefresh = NO;
}
// In case of split view controller where the primary and secondary view controllers are displayed side-by-side on screen,
@@ -432,24 +429,6 @@ static NSMutableDictionary* backgroundByImageNameDict;
[self.recentsTableView setEditing:NO];
}
#pragma mark - Override UISearchBarDelegate
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
{
// Prepare table refresh on new search session
shouldScrollToTopOnRefresh = YES;
[super searchBar:searchBar textDidChange:searchText];
}
- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar
{
// Prepare table refresh on end of search
shouldScrollToTopOnRefresh = YES;
[super searchBarCancelButtonClicked: searchBar];
}
#pragma mark - UITableView delegate
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section