1

There is a cancel button when you use a UISearchcontroller.

I want to make something happen when I press the cancel button.

Is there any Function or Delegate that trigger when the cancel button is clicked?

Junwoo Lee
  • 489
  • 1
  • 5
  • 15

1 Answers1

2

Try this:

self.searchController.searchBar.delegate = self;

- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {
}
Paul Roub
  • 36,322
  • 27
  • 84
  • 93
Bhupat Bheda
  • 1,968
  • 1
  • 8
  • 13