【问题标题】:Add links to Swift classes in the quick help documentation comments?在快速帮助文档注释中添加指向 Swift 类的链接?
【发布时间】:2017-09-23 22:04:45
【问题描述】:

假设我有两个班级:

/**
  This class should be used together with [Foo]( ??? ).
*/
class Bar {
    func doNothing() {}
}

/**
  Description of what Foo does goes here.
*/
class Foo {
    func doNothing() {}
}

我想从 Bar 在 Xcode 中的快速帮助中创建指向 Foo 或 Foo 的快速帮助的链接。甚至可能吗?如果有,怎么做?

通过查看Apple's docsmore Apple's docs 可以看出,链接的[name](target) 语法并不符合标准。

【问题讨论】:

  • 可能会有所帮助:stackoverflow.com/a/28633899/1457385
  • 肯定是一个好帖子,但它没有解决我的问题。
  • 以上问题你找到解决办法了吗?
  • 没有。我放弃了,我觉得不可能。
  • 好像是这样。可惜,我很喜欢:(

标签: swift xcode documentation comments


【解决方案1】:

我只是偶然发现了这一点。显然,如果您用反引号括起来的文本恰好是一个类,它将被呈现为该类的超链接。

【讨论】:

  • 我刚刚试过这个:/** Example: "Bar()", another example: "doNothing()" */ - 它只是将字体更改为等宽字体并且没有添加链接。编辑:Stackoverflow 将反引号包围的函数名称更改为代码...要自己尝试,请将四个引号替换为反引号。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-07-14
  • 1970-01-01
  • 2022-01-04
  • 1970-01-01
  • 2016-10-04
  • 2021-11-15
  • 1970-01-01
相关资源
最近更新 更多