@@ -513,6 +513,14 @@ extension OnboardingViewController: UITextFieldDelegate {
513513 public func textFieldDidEndEditing( _ textField: UITextField ) {
514514 if textField === nameTextField {
515515 viewModel. send ( input: . checkNameFormat( name: textField. text ?? " " ) )
516+ guard let name = textField. text, !name. isEmpty else { return }
517+ if !onBoardingStack. arrangedSubviews. contains ( genderStack) && nameTextField. text!. count < 7 {
518+ UIView . animate ( withDuration: 0.2 , delay: 0 , options: . curveEaseInOut) {
519+ self . onBoardingStack. insertArrangedSubview ( self . genderStack, at: 0 )
520+ self . genderStack. alpha = 1.0
521+ self . onBoardingStack. layoutIfNeeded ( )
522+ }
523+ }
516524 } else if textField === birthTextField {
517525 viewModel. send ( input: . checkBirthFormat( birth: textField. text ?? " " ) )
518526 }
@@ -569,21 +577,8 @@ extension OnboardingViewController: UITextFieldDelegate {
569577
570578 public func textFieldShouldReturn( _ textField: UITextField ) -> Bool {
571579 if textField === nameTextField {
572- guard let name = textField. text, !name. isEmpty else {
573- return false
574- }
575-
576580 textField. resignFirstResponder ( )
577-
578- if !onBoardingStack. arrangedSubviews. contains ( genderStack) && nameTextField. text!. count < 7 {
579- UIView . animate ( withDuration: 0.2 , delay: 0 , options: . curveEaseInOut) {
580- self . onBoardingStack. insertArrangedSubview ( self . genderStack, at: 0 )
581- self . genderStack. alpha = 1.0
582- self . onBoardingStack. layoutIfNeeded ( )
583- }
584- }
585581 }
586-
587582 return true
588583 }
589584
0 commit comments