NSAttributedStringKey doesn't work
Closed this issue · 3 comments
Yurikage commented
public var placeholderColor:UIColor?{
didSet{
guard let color = placeholderColor else { return }
attributedPlaceholder = NSAttributedString(string: placeholderFinal,
attributes: [NSAttributedStringKey.foregroundColor:color])
}
}
Type 'NSAttributedStringKey' (aka 'NSString') has no member 'foregroundColor'
how to fix it?
iDhaval commented
which swift version are you using?
nick-havz commented
If you're using the library from a pod, in your workspace select the DTTextField target in the Pod project. Browse down to "Swift Language Version" and switch it to > Swift 4.0.
When I added the pod the compiler was set on version 3.3 which was causing that code block to result in an error.
iDhaval commented
Upgraded to swift 5.0