[英]How to add documentation to enum associated values in Swift
Is there a way to add descriptions to associated values of enums in Swift 3? 有没有办法在Swift 3中为枚举的关联值添加描述? I want them to show up in the symbol documentation popup (option+click), like they do for function parameters in Xcode 8.
我希望它们出现在符号文档弹出窗口(选项+单击)中,就像它们对Xcode 8中的函数参数一样。
This is my enum: 这是我的枚举:
enum Result {
/**
Request succeeded.
- Parameters:
- something: Some description.
- otherThing: Other description.
*/
case Success(something: Int, otherThing: Int)
/**
Request failed.
- Parameter error: Error.
*/
case Error(error: Error)
}
I tried using - Parameters:
, but it doesn't work in enums. 我尝试使用
- Parameters:
,但它在枚举中不起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.