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 { ...@@ -184,7 +184,11 @@ open class TextField: UITextField {
return placeholderLabel.text return placeholderLabel.text
} }
set(value) { set(value) {
placeholderLabel.text = value if isEditing && isPlaceholderUppercasedWhenEditing {
placeholderLabel.text = value?.uppercased()
} else {
placeholderLabel.text = value
}
layoutSubviews() layoutSubviews()
} }
} }
...@@ -642,10 +646,16 @@ extension TextField { ...@@ -642,10 +646,16 @@ extension TextField {
updatePlaceholderLabelColor() updatePlaceholderLabelColor()
guard isPlaceholderAnimated else { guard isPlaceholderAnimated else {
if isPlaceholderUppercasedWhenEditing {
placeholderLabel.text = placeholderLabel.text?.uppercased()
}
return return
} }
guard isEmpty else { guard isEmpty else {
if isPlaceholderUppercasedWhenEditing {
placeholderLabel.text = placeholderLabel.text?.uppercased()
}
return 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