I\'m implementing a search bar on my table, which should be pretty straight forward. I\'ve got these:
- (void)searchBarTextDidBeginEditing:(UISearchBar *)the
The method
- (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar
is only called when [searchBar resignFirstResponder]
is called.
The best place to call [searchBar resignFirstResponder]
is in the method
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
In swift:
- (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar;
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar;
Once I implemented searchBarSearchButtonClicked that solved it for me.
Even i faced the same problem.
Please find with the solution below
Implement Below methods
1.searchBarTextDidEndEditing
2.searchBarSearchButtonClicked
and make sure you [UISearchchbar resignfirstresponder]
in the second method mentioned above