iOS 5.x - detecting when user clicked on the search text field
-
04-06-2021 - |
Frage
How do I detect when the user pressed the empty text field in a generic search bar?
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