I have a simple scene (using storyboard in IB) with a Username and Password text box. I've set the keyboard to close when you are on the Password text field but can't get the next(return) button to work on the Username to switch the focus (or First Responder) to the Password text box.
I'm closing the keyboard while on the Password text field like this:
- (BOOL)textFieldShouldReturn:(UITextField *)theTextField {
if (theTextField == self.textPassword) {
[theTextField resignFirstResponder];
}
return YES;
}
I know it is something similar to this but just can't nail it down.
for those who want to use Swift language:
}
:-)
You have to add the UITextFieldDelegate in the header-file. Then you have to set
in the viewDidLoad-method. After that you can go on with
Here's what you would put:
I use this code that allows me to control the form behavior in the storyboard:
All you need is to assign the order value as
tag
, andreturnkey
according to Next or Done on each input control.