Frage

How do I detect when the user pressed the empty text field in a generic search bar?

War es hilfreich?

Lösung

1) You should set delegate property of your text field (UITextField or UISearchBar).

2) The you should implement in delegate following method:

- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField

or

- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar

that will be called whenever user wants to enter text.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top