I have tried to set UITextField
\"Placeholder\" color as dark.
NSAttributedString * search = [[NSAttributedString alloc] initWithSt
For iOS8, you can take advantage of @IBDesignable
& @IBInspectable
.
Here is a UITextField subclass in Swift which lets you set the placeholder color in Interface Builder and see the result instantly:
@IBDesignable class EDTextField: UITextField {
@IBInspectable var placeholderColor: UIColor = UIColor.whiteColor() {
didSet {
if let placeholder = self.placeholder {
let attributes = [NSForegroundColorAttributeName: placeholderColor]
attributedPlaceholder = NSAttributedString(string: placeholder, attributes: attributes)
}
}
}
}