相关疑难解决方法(0)

如何在Swift中为枚举关联值添加文档

有没有办法在Swift 3中为枚举的关联值添加描述?我希望它们出现在符号文档弹出窗口(选项+单击)中,就像它们对Xcode 8中的函数参数一样.

这是我的枚举:

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)
}
Run Code Online (Sandbox Code Playgroud)

我尝试过使用- Parameters:,但它在枚举中不起作用.

xcode swift

15
推荐指数
2
解决办法
2234
查看次数

标签 统计

swift ×1

xcode ×1