6

I want to get a carriage return/new line by hitting the return key on an UITextField's keyboard. I've found out, that textFieldShouldReturn gets called.

But how do I insert a carriage return in the text field?

2
  • Is there a reason that you are using a UITextField instead of a UITextView? The UITextView was created specifically for allowing multiple lines of editable text. Apr 27, 2009 at 14:21
  • Bummer... Thanks, that solved my problem! I haven't thought about that. Have a nice day! :-)
    – Stefan
    Apr 27, 2009 at 14:51

1 Answer 1

13

You want to use a UITextView instead. UITextFields are meant for single line input whereas UITextViews support multi-line input.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.