如何使用Xcode 6内联代码文档Swift源代码

Lui*_*ios 4 code-documentation swift xcode6

我一直在使用Xcode 5的能力,用支持的注释语法记录我的代码(参见这个问题).Xcode 6使用Objective-C源支持它,遗憾的是没有使用Swift源.

我想在.swift源代码上执行内联文档.知道如何做或最佳做法?

提前致谢,

路易斯

小智 8

以下是一些用于记录Xcode 6中的swift代码的东西.它对冒号非常错误和敏感,但它总比没有好:

class Foo {

    /// This method does things.
    /// Here are the steps you should follow to use this method
    ///
    /// 1. Prepare your thing
    /// 2. Tell all your friends about the thing.
    /// 3. Call this method to do the thing.
    ///
    /// Here are some bullet points to remember
    ///
    /// * Do it right
    /// * Do it now
    /// * Don't run with scissors (unless it's tuesday)
    ///
    /// :param: name The name of the thing you want to do
    /// :returns: a message telling you we did the thing
    func doThing(name : String) -> String {
        return "Did the \(name) thing";
    }
}
Run Code Online (Sandbox Code Playgroud)

如上所述,您可以使用格式化数字列表,项目符号,参数和返回值文档在快速帮助中呈现上述内容.

这些都没有记录 - 提交雷达来帮助他们.