So I'm trying to make the "Cancel" button not show:
- (void)didPresentSearchController:(UISearchController *)searchController { searchController.searchBar.showsCancelButton = NO; } When you click on the text box UISearchBar button at the moment it appears and disappears.
I tried to do the same in the method that is called a little earlier:
- (void)willPresentSearchController:(UISearchController *)searchController { searchController.searchBar.showsCancelButton = NO; } To no avail, the didPresentSearchController property showsCancelButton comes YES . Because of this, the button appears at the moment and disappears, after setting the property to NO . What is the problem?