【发布时间】:2017-10-24 06:57:34
【问题描述】:
我正在将 cocoapod 用于 ibanimatable。我之前将它与 xcode 一起使用,它工作正常。但现在我更新 pod 时它开始给我错误。
public extension PlaceholderDesignable where Self: UITextField {
var placeholderText: String? { get { return "" } set {} }
public func configurePlaceholderColor() {
let text = placeholder ?? placeholderText
if let placeholderColor = placeholderColor, let placeholder = text {
attributedPlaceholder = NSAttributedString(string: placeholder, attributes: [.foregroundColor: placeholderColor])
}
}
}
下面的行给了我错误
attributedPlaceholder = NSAttributedString(string: placeholder, attributes: [.foregroundColor: placeholderColor])
类型“字符串”没有成员“前景颜色”
请告诉我如何才能摆脱这个问题?
【问题讨论】:
标签: ios swift xcode ios11 xcode9