Skip to content

Commit

Permalink
[Feat] sopt-makers#12 - alert 발생 시 TextField 색 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
lsj8706 committed Nov 28, 2022
1 parent b7cea98 commit 15f5b04
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,31 @@ extension SignUpVC {
} receiveValue: { [weak self] alertText in
guard let self = self else { return }
self.nickNameTextFieldView.changeAlertLabelText(alertText)
if !alertText.isEmpty {
self.nickNameTextFieldView.setTextFieldViewState(.alert)
}
}.store(in: cancelBag)

output.emailAlert.sink { event in
print("event: \(event)")
} receiveValue: { [weak self] alertText in
guard let self = self else { return }
self.emailTextFieldView.changeAlertLabelText(alertText)
if !alertText.isEmpty {
self.emailTextFieldView.setTextFieldViewState(.alert)
}
}.store(in: cancelBag)

output.passwordAlert.sink { event in
print("event: \(event)")
} receiveValue: { [weak self] alertText in
guard let self = self else { return }
self.passwordCheckTextFieldView.changeAlertLabelText(alertText)
if !alertText.isEmpty {
alertText == I18N.SignUp.invalidPasswordForm ? self.passwordTextFieldView.setTextFieldViewState(.alert) : self.passwordCheckTextFieldView.setTextFieldViewState(.alert)
} else {
self.passwordCheckTextFieldView.setTextFieldViewState(.editing)
}
}.store(in: cancelBag)

output.isValidForm.sink { event in
Expand Down

0 comments on commit 15f5b04

Please sign in to comment.