You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In iOS 8, UISearchDisplayController has been deprecated in favour of using UISearchController instead.
The interface of UISearchController works quite differently: it takes a result view, as well as a so called id <UISearchResultsUpdating> delegate to let the user have a chance of updating the UI.
I thought TLTableViewController's automatic table updates would provide a perfect drop-in implementation of this method. All one needs to do is update the data model:
- (void)updateSearchResultsForSearchController:(UISearchController *)searchController {
NSString *searchText = searchController.searchBar.text;
// ... Create a new array-based data model based on the search text.
TLIndexPathDataModel *dataModel = f(searchText);
self.indexPathController.dataModel = dataModel; // implicitly calls `performUpdates... on table view`
}
However, surprisingly, this does not actually work. The UI of the table view doesn't get updated with the latest rows.
I'm using ignoreDataModelUpdates = YES and an explicit [tableView reloadData] to workaround this for the time being.
The text was updated successfully, but these errors were encountered:
In iOS 8, UISearchDisplayController has been deprecated in favour of using UISearchController instead.
The interface of UISearchController works quite differently: it takes a result view, as well as a so called id delegate to let the user have a chance of updating the UI.
(void)updateSearchResultsForSearchController:(UISearchController *)searchController;
I thought TLTableViewController would be a perfect drop-in implementation of this method:
// ... Create a new array-based data model based on the search text.
TLIndexPathDataModel *dataModel = f(searchText);
self.indexPathController.dataModel = dataModel; // implicitly calls performUpdates... on table view
}
However, surprisingly, this does not actually work. The UI of the table view doesn't get updated with the latest rows.
I'm using ignoreDataModelUpdates = YES and an explicit [tableView reloadData] to workaround this for the time being.
—
Reply to this email directly or view it on GitHub.
In iOS 8,
UISearchDisplayController
has been deprecated in favour of usingUISearchController
instead.The interface of
UISearchController
works quite differently: it takes a result view, as well as a so calledid <UISearchResultsUpdating>
delegate to let the user have a chance of updating the UI.- (void)updateSearchResultsForSearchController:(UISearchController *)searchController;
I thought
TLTableViewController
's automatic table updates would provide a perfect drop-in implementation of this method. All one needs to do is update the data model:However, surprisingly, this does not actually work. The UI of the table view doesn't get updated with the latest rows.
I'm using
ignoreDataModelUpdates = YES
and an explicit[tableView reloadData]
to workaround this for the time being.The text was updated successfully, but these errors were encountered: