Iphone – How to retract the Keyboard on touching the UITextView when keyboard is already up

iphoneuitextview

I am writing an application that has a UITextView which allows editing. When a user first touches UITextView, a keyboard shows up and I want to retract that keyboard when user again touches the UITextView e.g. I have entered some data in a textview and with keyboard still showing on the screen I tap on the UITextView which should cause the keyboard to retract.

Is there any way to achive this?

(I'm aware of providing a done button and doing this but I want to achive this by tapping on UITextView itself)

Best Answer

As an aside, I would urge you not to use toggle state elements on the iPhone. It's to easy to double tap in real world use. That is why the Apple apps all use the either the "return" key on the keyboard or the done button.

In the interface you contemplate, the users will find themselves closing and then accidentally reopening the keyboard about 10% of the time or more. It will make your app feel cumbersome and flaky.

Related Topic