I have a text field and a "go" button. I have it set to dismiss keyboard whenever user presses return and then run the action, however, I would also like to dismiss the keyboard if the user presses my go button also. Is there a way to do this?
Worst case I'll just remove the go button and have the user have to use the return key.
I have a text field and a "go" button. I have it set to dismiss keyboard whenever user presses return and then run the action, however, I would also like to dismiss the keyboard if the user presses my go button also. Is there a way to do this?
Worst case I'll just remove the go button and have the user have to use the return key.
Thanks
Hi,
Before I respond, have you tried using google? I found this solution just two days ago in a couple minutes using google. If you can't find anything, I can help you with your search!
Before I respond, have you tried using google? I found this solution just two days ago in a couple minutes using google. If you can't find anything, I can help you with your search!
I was on google a long time before I came here. I must be searching the wrong thing, I'm not sure what to look for.
Get a reference to the textfield and call resignFirstResponder on it.
I connected the did end on exit to the action where I resignFirstResponder and that takes care of removing the keyboard on the return key but I have another button I want to ALSO remove the keyboard. If you were telling me a different way to do it I don't understand what you are talking about. Could you please elaborate?
No, you need to get a reference to your textfield and call resignFirstResponder on that. If "Input" is your textfield, you need to call the method on it.
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.
No, you need to get a reference to your textfield and call resignFirstResponder on that. If "Input" is your textfield, you need to call the method on it.
My problem is I don't fully understand the terminology you are using.
Do you mind telling me the steps to get this to work? Thanks for all the responses.
Ok, I'm going to assume "Input" is your textfield. Call resignFirstResponder on "Input", like how you are currently calling CommandHandler on self. Also, you might want to look in coding conventions such as camelCase.
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.