Possible Duplicate:
How to create a multiline UITextfield?
UITextField delegate will capture return key: - (BOOL)textFieldShouldReturn:(UITextField *)textField
but it won't do multiline like UITextView can. But UITextView, can it capture return key?
I need to capture key events: (return) and do multiline: "\n"....
What can I do? thx
A quick google search for "UITextView detect return" came up with this thread:
UITextView (editing) - detecting that next line event occured
(for convenience sake, I've posted the code below)
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text;
{
if ( [text isEqualToString:@"\n"] ) {
//Do whatever you want
}
return YES;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With