I need to disabled a button when theres no text in the search bar and enable the button when there is text in it.
I presume there must be an event or a way to detect the status of the text in the search bar ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I would utilize the UISearchBarDelegate class and implement the textDidChange method (UISearchBarDelegate reference).
You can use this to “detect” changes to the search field and change the enable state of the button as the user edits the contents of the search bar.