Search for everything when user taps "search" on keyboard (IOS-141)

This commit is contained in:
Nathan Mattes 2023-09-20 19:59:46 +02:00
parent 5370d00504
commit 5c71b7ef45
2 changed files with 6 additions and 0 deletions

View File

@ -34,6 +34,7 @@ class SearchResultsOverviewTableViewController: UIViewController, NeedsDependenc
self.coordinator = sceneCoordinator
tableView = UITableView(frame: .zero, style: .insetGrouped)
tableView.keyboardDismissMode = .onDrag
tableView.translatesAutoresizingMaskIntoConstraints = false
tableView.backgroundColor = .systemGroupedBackground
tableView.separatorInset.left = 62

View File

@ -265,7 +265,12 @@ extension SearchDetailViewController: UISearchBarDelegate {
}
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
guard let searchText = searchBar.text, searchText.isNotEmpty else { return }
searchBar.resignFirstResponder()
let searchResultViewModel = SearchResultViewModel(context: context, authContext: viewModel.authContext, searchScope: .all, searchText: searchText)
coordinator.present(scene: .searchResult(viewModel: searchResultViewModel), transition: .show)
}
func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {