UISearchbar clearButton forces the keyboard to appear
- by DASKAjA
I have a UISearchBar which acts as a live filter for a table view. When the keyboard is dismissed via endEditing:, the query text and the gray circular "clear" button remain. From here, if I tap the gray "clear" button the keyboard reappears as the text is cleared.
How do I prevent this? If the keyboard is not currently open I want that button to clear the text without reopening the keyboard.
There is a protocol method that gets called when I tap the clear button. But sending the UISearchBar a resignFirstResponder message doesn't have any effect on the keyboard.