2

I have a standard iOS UITableView with UISearchBar. It all works fine. I've implemented a method that hides the search bar when a user taps the Cancel button by implementing the searchBarCancelButtonClicked:(UISearchBar *)searchBar delegate method. That's all good.

But here's my question:

When a user taps the search button, and does not search for anything, no delegate method is called when he/she taps on the dimmed out space where no search results are displayed. You know which space I mean? The one that would either display "no results" or the search results. When no text is entered into the search bar, this dimmed out space is empty - and reacts to a user's touch (dismissing the searching table view).

Is there a delegate method associated with this touch event? Or is there a workaround to detect this particular touch?

You can examine my code on GitHub: https://github.com/versluis/Table-Seach-2013

Here's a screenshot to illustrate:

enter image description here

4

2 回答 2

3
- (void)searchDisplayControllerDidEndSearch:(UISearchDisplayController *)controller
于 2013-11-28T17:52:47.797 回答
-1
-(void)willDismissSearchController:(UISearchController *)searchController
于 2015-12-27T07:47:20.883 回答