Possible Duplicate:
Dismiss keyboard on touch anywhere outside UITextField
I am using UIScrollView in my app. I am putting few text fields and button. I want to hide my keyboard when they touch outside of the textbox. (I mean they will be taping on the uiscrollview). I have tried a lot of things… I use UIGestureRecognizer but its not working… help please
Here’s the solution just tried and it works.. Hope helps
Add the following code to your viewDidLoad;
Hope helps….