我一直在使用Xcode 5的功能来用支持的注释语法(see this SO question)记录我的代码。Xcode 6用Objective源代码来支持它,不幸的是它没有使用Swift源代码。
我想在.swift源代码上执行内联文档。知道怎么做或最佳实践吗?
提前谢谢你,
路易斯
发布于 2014-06-29 13:41:11
似乎您仍然可以添加函数的描述:
/**
This is a description of my function
*/
func myFunc() {
}
///this is a description of my second function
func myFunc2(){
}但是,目前不支持任何headerdoc标记。Xcode 6发布时可能会支持它。
发布于 2014-07-23 02:33:00
以下是在Xcode 6中记录快速代码的一些功能。它非常错误,对冒号很敏感,但它总比没有好:
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";
}
}上面的内容是在Quick中呈现的,正如您所期望的那样,可以使用格式化的数字列表、项目点、参数和返回值文档。
所有这些都没有记录在案--用雷达来帮助他们前进。
https://stackoverflow.com/questions/24475243
复制相似问题