UISearchDisplayController - Pressing an overlay called method?

Is there a delegate method that is called when the user clicks on a dark overlay that basically removes the status of the first responder from the UISearchDisplayController? (I can not find it in the documents.)

I would like to know when users press the black invoice and the keyboard is hidden.

+4
source share
1 answer

If you are implementing UISearchDisplayDelegate, then:

- (void)searchDisplayControllerDidEndSearch:(UISearchDisplayController *)controller 

call overlay should be called.

I mixed up with these components a few months ago, but did not use it because you cannot change its standard behavior much.

What I found out is that it is just a wrapper for the UISearchBar , so you can access the searchBar on your SearchDisplayController as follows:

 [searchDisplayController.searchBar setDelegate:self]; 

This method gives you more freedom of access to the delegate methods of the searchBar itself. For example textDidChange , cancelButtonClicked , etc.

+1
source

Source: https://habr.com/ru/post/1337811/


All Articles