The return key doesn’t do anything special in a text field by default. You need to explicitly change the first responder:
- (BOOL)textFieldShouldReturn:(UITextField *)theTextField {
if (theTextField == self.textPassword) {
[theTextField resignFirstResponder];
} else if (theTextField == self.textUsername) {
[self.textPassword becomeFirstResponder];
}
return YES;
}