上下文成员在 Swift 3 中没有关联值
Contextual member has no associated value in Swift 3
翻译代码时
[=11=].backgroundColor = .redColor()
进入Swift 3 我收到这个错误:
/Users//Documents/projects//MyCell.swift:52:35: Contextual member 'redColor' has no associated value
如何手动翻译此代码?
在 Swift 3 .redColor()
中更改为 .red
。
[=10=].backgroundColor = .red
有关此内容的更多详细信息,请阅读 UIColor
上的 Apple Documentation Symbols
部分检查 Type Properties
。
翻译代码时
[=11=].backgroundColor = .redColor()
进入Swift 3 我收到这个错误:
/Users//Documents/projects//MyCell.swift:52:35: Contextual member 'redColor' has no associated value
如何手动翻译此代码?
在 Swift 3 .redColor()
中更改为 .red
。
[=10=].backgroundColor = .red
有关此内容的更多详细信息,请阅读 UIColor
上的 Apple Documentation Symbols
部分检查 Type Properties
。