extension UITextField
@IBInspectable var placeholdercolor: UIColor
{
willSet {
attributedPlaceholder = NSAttributedString(string: placeholder != nil ? placeholder! : "", attributes:[NSAttributedStringKey.foregroundColor: placeholdercolor])
}}
I am creating extension for UITextField for placeholder colour . I don't want to create custom class and I also try
@IBInspectable var placeholdercolor: UIColor
{
get
{
return self.placeholdercolor
}
set
{
attributedPlaceholder = NSAttributedString(string: placeholder != nil ? placeholder! : "", attributes:[NSAttributedStringKey.foregroundColor: placeholdercolor])
}
}
but it is giving error (Thread 1: EXC_BAD_ACCESS) on method
get
{
return self.placeholdercolor
}
please help