gpt4 book ai didi

swift - Swift 类扩展的文档注释

转载 作者:搜寻专家 更新时间:2023-10-31 22:19:04 24 4
gpt4 key购买 nike

我正在扩展 UIColor,并尝试提供 a description扩展类。

我的代码是

/**
- To store all colors
- Naming Convention identifier: In lowerCamelCase with single name description
- Naming Convention value: single name

- example: self.view.backgroundColor = UIColor.View.NonCompliant

*/
extension UIColor{

/**
- To specify all seperators' color
*/
struct Seperators{
static let commonSeperator = UIColor(red: 53.0/255.0, green: 126.0/255.0, blue: 167.0/255.0, alpha: 1.0)
}
}

但是 Xcode 仍然显示原始描述而不是修改后的描述。

有人知道怎么做吗?

最佳答案

您可以使用 xcode 的文档。选择方法名称和 Xcode->Editor->Structure->Add Documentation。 Xcode 为您生成文档。或者快捷键 alt + cmd +/

关于swift - Swift 类扩展的文档注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45325782/

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