How to dynamically change placeholder color of the UITextField
?
This is always the same system color.
No option in xib editor.
I use this in SWIFT:
myTextField.attributedPlaceholder =
NSAttributedString(string: "placeholder", attributes: [NSForegroundColorAttributeName : UIColor.redColor()])
It seems that this works for others... I have no idea why it haven't worked for me before... maybe some project settings. Thanks for the comments. Currently I have no way how to test it again.
Obsolete: But I don't know why, text is applied correctly, but placeholder color remains same (black/gray).
--iOS8