mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-03 22:56:57 +02:00
Public rooms search: Automatically scroll to the top on each new seach
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user