开发者

UISearchDisplayController - Clicking overlay, method called?

开发者 https://www.devze.com 2023-02-07 22:38 出处:网络
Is there a delegate method that gets called when a user clicks on the dark overlay, which basically removes first responder status from the UISearchD开发者_JS百科isplayController? (I cannot find one i

Is there a delegate method that gets called when a user clicks on the dark overlay, which basically removes first responder status from the UISearchD开发者_JS百科isplayController? (I cannot find one in the docs.)

I would like to know when users click the black overlay, and the keyboard is hidden.


If you implement the UISearchDisplayDelegate then:

- (void)searchDisplayControllerDidEndSearch:(UISearchDisplayController *)controller

should be called upon tapping the overlay.

I messed around with this components a few months back but ended up not using it because you can not change its standard behavior much.

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

[searchDisplayController.searchBar setDelegate:self];

This way gives you a bit more freedom to access the delegate methods of the searchBar component itself. Like textDidChange, cancelButtonClicked etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消