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. Commented Apr 27, 2009 at 14:21
  • Bummer... Thanks, that solved my problem! I haven't thought about that. Have a nice day! :-) Commented 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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.