首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用Xcode 6内联代码文档Swift源代码

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

Stack Overflow用户
提问于 2014-06-29 10:33:59
回答 2查看 2.8K关注 0票数 4

我一直在使用Xcode 5的功能来用支持的注释语法(see this SO question)记录我的代码。Xcode 6用Objective源代码来支持它,不幸的是它没有使用Swift源代码。

我想在.swift源代码上执行内联文档。知道怎么做或最佳实践吗?

提前谢谢你,

路易斯

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-06-29 13:41:11

似乎您仍然可以添加函数的描述:

代码语言:javascript
复制
/**
This is a description of my function
*/
func myFunc() {

}
///this is a description of my second function
func myFunc2(){

}

但是,目前不支持任何headerdoc标记。Xcode 6发布时可能会支持它。

票数 2
EN

Stack Overflow用户

发布于 2014-07-23 02:33:00

以下是在Xcode 6中记录快速代码的一些功能。它非常错误,对冒号很敏感,但它总比没有好:

代码语言:javascript
复制
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中呈现的,正如您所期望的那样,可以使用格式化的数字列表、项目点、参数和返回值文档。

所有这些都没有记录在案--用雷达来帮助他们前进。

票数 8
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24475243

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档