forked from zelo72/mastodon-ios
chore: update function signature
This commit is contained in:
parent
7ad09468e2
commit
087413009d
|
@ -228,7 +228,7 @@ extension MastodonRegisterViewController {
|
|||
|
||||
domainLabel.text = "@" + viewModel.domain + " "
|
||||
domainLabel.sizeToFit()
|
||||
passwordCheckLabel.attributedText = MastodonRegisterViewModel.attributeStringForPassword(isValid: false)
|
||||
passwordCheckLabel.attributedText = MastodonRegisterViewModel.attributeStringForPassword(validateState: .empty)
|
||||
usernameTextField.rightView = domainLabel
|
||||
usernameTextField.rightViewMode = .always
|
||||
usernameTextField.delegate = self
|
||||
|
@ -441,7 +441,7 @@ extension MastodonRegisterViewController {
|
|||
.sink { [weak self] validateState in
|
||||
guard let self = self else { return }
|
||||
self.setTextFieldValidAppearance(self.passwordTextField, validateState: validateState)
|
||||
self.passwordCheckLabel.attributedText = MastodonRegisterViewModel.attributeStringForPassword(isValid: validateState == .valid)
|
||||
self.passwordCheckLabel.attributedText = MastodonRegisterViewModel.attributeStringForPassword(validateState: validateState)
|
||||
}
|
||||
.store(in: &disposeBag)
|
||||
viewModel.passwordErrorPrompt
|
||||
|
|
|
@ -180,12 +180,12 @@ extension MastodonRegisterViewModel {
|
|||
return NSAttributedString(attachment: attachment)
|
||||
}
|
||||
|
||||
static func attributeStringForPassword(isValid: Bool) -> NSAttributedString {
|
||||
static func attributeStringForPassword(validateState: ValidateState) -> NSAttributedString {
|
||||
let font = UIFont.preferredFont(forTextStyle: .caption1)
|
||||
let attributeString = NSMutableAttributedString()
|
||||
|
||||
let image = MastodonRegisterViewModel.checkmarkImage(font: font)
|
||||
attributeString.append(attributedStringImage(with: image, tintColor: isValid ? .black : .clear))
|
||||
attributeString.append(attributedStringImage(with: image, tintColor: validateState == .valid ? .black : .clear))
|
||||
attributeString.append(NSAttributedString(string: " "))
|
||||
let eightCharactersDescription = NSAttributedString(string: L10n.Scene.Register.Input.Password.hint, attributes: [NSAttributedString.Key.font: font, NSAttributedString.Key.foregroundColor: UIColor.black])
|
||||
attributeString.append(eightCharactersDescription)
|
||||
|
|
Loading…
Reference in New Issue