Swift 3错误:"See also"提示未显示

36

我刚将我的项目迁移到了Swift 3,并发现快速帮助中的“参见”提示未显示。在Swift的先前版本中,一切都运作得非常完美。以下是我的代码:

/**
 Adds a "See also" callout in the Quick Help for a symbol using the `seealso` delimiter. Multiple "See also" callouts appear in the description section in the same order as they do in the markup.

 - author: Tapas Pal

 - remark: Use the callout to add references to other information.

 - seealso: [The Swift Standard Library Reference](https://developer.apple.com/library/prerelease/ios//documentation/General/Reference/SwiftStandardLibraryReference/index.html)
*/
class SeeAlsoMarkup: NSObject {
    static func doSomething() {}
}

输出如下:

这里输入图片描述

苹果是否更改了此标记?苹果的See Also标记格式参考仍显示seealso作为有效的callout。


1
我认为@ShubhamNaik是正确的。 seeAlso 对我也有效。 - Jevon718
1
@Jevon718 你使用的Xcode版本(构建)是什么?对我来说还是不起作用。 - nemissm
2
这在Xcode 10.1中仍然是一个问题,所有的“- seealso:”,“- seeAlso:”,“- SeeAlso:”都会在注释中被高亮,但在文档中都不起作用(当按住alt键单击时)。 - Sajjon
5
@Neph:在 Xcode 11 beta 4 中仍存在问题。 - cumanzor
1
在Xcode 13rc1中相同。 - Aliaksandr Bialiauski
显示剩余10条评论
2个回答

8

(XCode 11, Swift 5)

为了澄清这个问题,看起来XCode能够识别文档注释中的Markdown语法。如果你有像下面这样的内容:

/// # Reference 
/// [Link to Reference](https://www.google.com)

记录为:

参考标记的屏幕截图

我不知道这是否与@seealso以相同的方式钩入文档关键字,因为 # markdown 标记只是指向一个标题样式。为了证明这一点,您可以使用#标记添加任意部分到您的文档中:

///  # Reference
///  [Link to Reference](https://www.google.com)
///  # Section
///  This is a new section of documentation
///  # Remark
///  New remark

记录为:

在此输入图片描述


6

seealso替换为# 参考

Quick Help screenshot


1
@Sajjon,使用 # Reference \n [Title](link) 替代 - SeeAlso: [Title](link) - farzadshbfn
2
使用 # 引用时,Xcode 不会显示包含的链接。 - Igor Kovryzhkin
@KIO,如果在“Reference”后面有一个换行符,它就会起作用。 - NRitH

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接