I have a search bar with cancel button. But when I click on Cancel button it doesn\'t close the search bar. How can I make that on click on Cancel it will return search bar to t
I am also come across with this problem, in my case after searching any item from table view than click one of the result item it's opened details view but search bar does not disappeared. I use Nicat's answer with a little changes, here is my version:
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
searchController.isActive = false
self.searchBarCancelButtonClicked(searchController.searchBar)
...
}