For UITextField, you can change the return key to a ready-made key by setting the following:
targetTextField.returnKeyType = UIReturnKeyDone;
However, you cannot enter the Enter and Done key at the same time without adding custom views to the keyboard.
In addition, to control the behavior of the keyboard, you must implement the UITextFieldDelegate method:
targetTextField.delegate = self; - (BOOL)textFieldShouldReturn:(UITextField *)textField{ return YES;
I know that you can set returnKeyType for a UITextView, but I'm not sure if you can manipulate the behavior of the returned key.
source share