Skip to content

Commit

Permalink
fix/#388 텍스트필드 상태 변화 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
youz2me committed Sep 20, 2024
1 parent 79b1f6c commit 370c27b
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ class CreateMeetingViewController: BaseViewController {
)
)
}

override func setupDelegate() {
rootView.nameTextField.delegate = self
}
}


Expand All @@ -91,8 +95,12 @@ private extension CreateMeetingViewController {
switch state {
case .valid:
owner.rootView.presentButton.isEnabled = true
owner.rootView.nameTextField.layer.borderColor = UIColor.maincolor.cgColor
owner.rootView.characterLabel.textColor = .maincolor
case .invalid:
owner.rootView.errorLabel.isHidden = false
owner.rootView.nameTextField.layer.borderColor = UIColor.mainred.cgColor
owner.rootView.characterLabel.textColor = .mainred
case .empty:
break
}
Expand Down Expand Up @@ -178,3 +186,14 @@ private extension CreateMeetingViewController {
}
}
}

extension CreateMeetingViewController: UITextFieldDelegate {
func textFieldDidBeginEditing(_ textField: UITextField) {
textField.layer.borderColor = UIColor.maincolor.cgColor
}

func textFieldDidEndEditing(_ textField: UITextField) {
rootView.characterLabel.textColor = .gray3
rootView.nameTextField.layer.borderColor = UIColor.gray3.cgColor
}
}

0 comments on commit 370c27b

Please sign in to comment.