Sunday
Jan232011
Dismiss iPhone keyboard
Sunday, January 23, 2011 at 10:40PM
Quick tip on how to dismiss the keyboard in iOS when a user touches anywhere on the screen outside of the UITextField or keyboard. Considering how much real estate the iOS keyboard can take up, it makes sense to have an easy and intuitive way for your users to dismiss the keyboard. Add the following code below to your .m file for your view controller.
Adam |
7 Comments |
Reader Comments (7)
What code? Muppet!
You cant see the Gist?
Wow, the first solution I stumbled upon online after an hour of searching that "just worked!" Thank you so much! =D
This looks like the kind of solution I've been looking for but it does not work.
I have a table view, three rows, one UITextField on each row. When I touch any of them the keyboard comes up but never goes back.
The instructions couldn't be any simpler. I've pasted the code on the .m file of my view controller. It's like I didn't put anything.
Any ideas why?
Thanks in advanced!
Works like a charm, thanks!
Dude... thank you!
thanks, very useful code.