I am working on an iOS project where I want to implement a search function. I use UISearchBarand UISearchDisplayController, and I would like to make a hidden hide UISearchBar. When the user clicks on UIBarButtonItem, the search bar and "startFirstResponder" appear, whereas when the user clicks the button Cancelon the search bar, it should disappear.
Appearance works correctly, but I have a problem with extinction. I managed to hide the search bar when the user clicked the button Cancel(method searchBarCancelButtonClicked), but I can’t hide the search bar when listening to the gray (darkened) background in UISearchDisplayController. As far as I know, there is no way to detect this event, so some hacks need to be applied. Do you know anything, or what is best discovered on a gray background?
source
share