Worked on UI is interesting part of iOS development
extension UITextField {
func setPlaceholderColor(color: UIColor) {
if let placeholder = placeholder {
attributedPlaceholder = NSAttributedString(string: placeholder, attributes: [NSForegroundColorAttributeName: color])
}
}
}
Way to use:
let textField = UITextField()
textField.setPlaceholderColor(.redColor())
Letโs try, itโs delicious! ๐ฏ๐ฎ๐๐