textField 의 delegate 를 이용해서 다음과 같이 다음 텍스트 필드로 가거나 함수를 호출할 수 있습니다.
extension LoginViewController: UITextFieldDelegate {
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
if textField == emailField {
passwordField.becomeFirstResponder()
}
else if textField == passwordField {
loginButtonTapped()
}
return true
}
}