Is there any way to achieve this with ErrorTextField
silnose opened this issue · 3 comments
silnose commented
daniel-jonathan commented
@silnose Hey! There isn't out of the box. You can subclass the ErrorTextField class and then add the UILabel and show it when the component is active/focus. Let me know how it goes, and I would be happy to help further if you show me an initial approach. I will close for now.
silnose commented
Thk for the early response @DanielDahan !.
I can do the thick following this steps:
- Set attribute 'isPlaceholderAnimated' to false:
textField.isPlaceholderAnimated = false
- Set property attributedPlaceholder
textField.attributedPlaceholder = NSAttributedString(string:"my real placeholder",
attributes: [NSAttributedString.Key.foregroundColor: UIColor(named: "cloudy_blue"
and magic happens!. The first one is acting like a label and the second one as a placeholder.
daniel-jonathan commented
Nicely done! And no added elements :)