Tushar Chutani
Tushar Chutani

Reputation: 1570

how to dissmiss keyboard in uisearchbar?

I am working a navigation based application. In my application user can search using the UISearchBar. Now I want the keyboard to be dismissed after the user hits search (or done not sure which one it is). I tried doing the way it is done for UITextField but didn't work. so any help would be appreciated.

thanks,

Upvotes: 1

Views: 619

Answers (1)

Daniel Ryan
Daniel Ryan

Reputation: 7100

Hope this helps for anyone that else was looking for this.

- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar {
    [sbSearch resignFirstResponder];
}

Using UISearchBarDelegate.

Upvotes: 4

Related Questions