Commit 361b858d by Michael Gaylord

Ensure the placeholder is uppercased even before editing if necessary

parent 09f63f91
......@@ -184,7 +184,11 @@ open class TextField: UITextField {
return placeholderLabel.text
}
set(value) {
placeholderLabel.text = value
if isEditing && isPlaceholderUppercasedWhenEditing {
placeholderLabel.text = value?.uppercased()
} else {
placeholderLabel.text = value
}
layoutSubviews()
}
}
......@@ -642,10 +646,16 @@ extension TextField {
updatePlaceholderLabelColor()
guard isPlaceholderAnimated else {
if isPlaceholderUppercasedWhenEditing {
placeholderLabel.text = placeholderLabel.text?.uppercased()
}
return
}
guard isEmpty else {
if isPlaceholderUppercasedWhenEditing {
placeholderLabel.text = placeholderLabel.text?.uppercased()
}
return
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment