tags:

views:

17

answers:

2

How to resign virtual keyboard for text view? is there any way same as textfieldshouldresignresponder?

+2  A: 
[aVariablePointingToAnObject resignFirstResponder];

aVariablePointingToAnObject being your UITextView (or another object that becomes the first responder)

or... if that is too confusing for you then please refer to this:

[textView resignFirstResponder];
Thomas Clayson
textField should be named textView, textField is normally used to UITextField.
Emil
Wow, you seriously managed to make the name even more confusing...
Emil
ffs... its not even that bit that's important! its the method `resignFirstResponder` that the OP is looking for!
Thomas Clayson
I am aware of resignFirstResponder but my point was :- Is there any method that gets called implicitly when the return key of keyboard is pressed while editing UITextView ??? TextField has the method textFieldShouldReturn in which we can resign the keyboard.
Javal Nanda
+1  A: 

UITextView and UITextField are both subclasses of UIResponder and both support resignFirstResponder.

Robot K