FloatLabelFields icon indicating copy to clipboard operation
FloatLabelFields copied to clipboard

placeHolder color

Open hugocarlmartin opened this issue 9 years ago • 1 comments

Hi, everything works like a charm. Except that I cant change my placeholder text as I usually do.

override var placeholder: String? {
    willSet(value) {
        super.attributedPlaceholder = NSAttributedString(string: value!, attributes: [NSForegroundColorAttributeName : UIColor.whiteColor(), NSFontAttributeName : self.font])
    }
}

Any ideas?

hugocarlmartin avatar Jul 30 '15 13:07 hugocarlmartin

@hugocarlmartin This seems to work. then you can set it in the story board

@IBInspectable var placeholderTextColour:UIColor = UIColor.grayColor() {
        didSet{
            if placeholder != nil
            {
                self.attributedPlaceholder = NSAttributedString(string: placeholder!, attributes: [NSForegroundColorAttributeName:placeholderTextColour])
            }
        }
    }

Lawgrin avatar Sep 22 '15 11:09 Lawgrin