Well, for reference, we have below two text fields,
UITextField *email_Text; email_Text.tag = 100; email_Text.delegate = self; UITextField *password_Text; password_Text.tag = 101; password_Text.delegate = self;
You must implement UITextFieldDelegate in the .h file.
Currently, iam does not use any highlighting methods here for text fields. You should select it or make it as an output if the text field is in xib yourself. I just have only two objects for reference. And also these objects should be globally accessible in the class (I mean you should declare it in the header).
The next step is to implement the textFieldShouldReturn: delegate textFieldShouldReturn: UITextField .
- (BOOL)textFieldShouldReturn:(UITextField *)textField { if(textField.tag == 100) { [password_Text becomeFirstResponder]; } else if(textField.tag == 101) { [textField resignFirstResponder]; } else { ;
Try it.
Happy coding :)
source share