Search code examples
iphoneiosuisearchdisplaycontroller

UISearchDisplayController - Method for when cancel button is clicked


I have a UISearchDisplayController that shows the cancel button. I would like to call a method when a user clicks the cancel button. Is there a way to do this?


Solution

  • You can use the following searchbar delegate method,

    - (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar
    {
         // DO ur operations
    }