0

I want to change the place holder color by setting the key path value from user defined runtime attribute and assign a custom color but it has no effect on placeholder color the value I set is as below

Please help I need this from storyboard instead of code

Awais Mobeen
  • 733
  • 11
  • 19

2 Answers2

0

Use :

placeholderLabel.attributedPlaceholder
Celeste
  • 1,519
  • 6
  • 19
0

use UITextField extension

    extension UITextField {
        func updatePlaceHolder(_ text: String, color: UIColor) {
            attributedPlaceholder = NSAttributedString(string: text,
                                                       attributes: [NSAttributedString.Key.foregroundColor: color])
        }
    }
//color set for textfield placeholder 
textFieldNumber.updatePlaceHolder("Mobile Number", color: UIColor.init(red: 0, green: 0, blue: 0.0980392, alpha: 0.22))