Detect UISearchBar orientation to text field

Is there a way to determine if the user clicks the search text box and the keyboard appears?

+5
source share
3 answers

From docs ,

  • searchBarTextDidBeginEditing:
  • searchBarCancelButtonClicked:
+10
source

If you are implementing UISearchBarDelegate, the first method to be called is:

- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar {  
    //do stuff
    return YES;  
}  

Here is a link to the class:

http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UISearchBarDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UISearchBarDelegate/searchBarShouldBeginEditing :

+8
source

searchBarTextDidBeginEditing:.

+3
source

All Articles