Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOS: action with enter key of iPad KeyBoard

I have two textfield, in first textfield I write "Hello" and when I push enter in iPad keyboard, I want that in second textfield appear "World"; How can I use enter to create an action in my application?

like image 668
cyclingIsBetter Avatar asked May 11 '11 11:05

cyclingIsBetter


People also ask

How do you hit enter on iPad keyboard?

The enter/return key does the same action as hitting the button in the lower-right of the keyboard. In some apps, it sends a message or performs an action; in others, it generates a newline. Messages does the latter. You have to use the Send button on the screen to send a message.

How do you press enter on iOS keyboard?

In order to add a line break, simply bring up the iOS keyboard, hold down the 'Shift' key and then press the 'Return' key at the same time.


1 Answers

You would typically assign your view controller as the text field's delegate and then implement the textFieldShouldReturn: method, e.g.:

- (BOOL)textFieldShouldReturn:(UITextField *)textField {     otherTextField.text = @"World"     return YES; } 
like image 146
omz Avatar answered Sep 21 '22 20:09

omz