How would I check for a return key tap on the keyboard when a text view is first responder? So far I think I have to check the text parameter in the shouldChangeTextIn callback method of UITextViewDelegate. How would I check whether text is a return?
A UITextView has a delegate. The delegate has the method textViewDidChange: Look at the last character and determine if it is "\n"
Use this type of code:
-(void)textViewDidChange:(UITextView *)textView{
if(textView.text.length>1)
if([[textView.text substringFromIndex:textView.text.length-1] isEqualToString:@"\n"]){
// the textView text ended with a return character
}
}