gpt4 book ai didi

swift - 上下文成员在 Swift 3 中没有关联值

转载 作者:搜寻专家 更新时间:2023-11-01 06:18:05 25 4
gpt4 key购买 nike

翻译代码时

$0.backgroundColor = .redColor()

进入 Swift 3 我收到这个错误:

/Users//Documents/projects//MyCell.swift:52:35: Contextual member 'redColor' has no associated value

如何手动翻译此代码?

最佳答案

在 Swift 3 中,.redColor() 被更改为 .red

 $0.backgroundColor = .red

有关此内容的更多详细信息,请阅读 Apple DocumentationSymbols 部分下的 UIColor 上检查 Type Properties

关于swift - 上下文成员在 Swift 3 中没有关联值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39867439/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com