I have a UITextView in my Navbar that is acting as a search box. I would like to dismiss the associated keyboard when the user taps below the text box – namely on the MKMapView. However I can’t figure out how to do this since it doesn’t look like I can intercept touches from the mapview.
I have looked at a number of solutions, but none seem to work for my case as far as I can tell. Does anyone have a simple way to do this? I am a bit of a noob, so please let me know if I am not providing some relevant information, and please provide a few lines of example code in your answer if you can – I am still a bit shaky with terminology. Thanks!
screenshot http://img532.imageshack.us/img532/4070/keyboardsm.png
Assuming
Then you can dismiss the keyBoard by sending:
Also: you may prefer to use a
UISearchBarand set it as thenavigationItem.titleViewof the ViewController. This offers some nice delegate methods.