【问题标题】:Swift 3 error: "See also" callout not showingSwift 3 错误:“另见”标注未显示
【发布时间】:2017-03-07 03:08:55
【问题描述】:

我刚刚将我的项目迁移到 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() {}
}

输出如下:

Apple 对这个标记有什么改变吗? Apple 的 See Also 标记格式参考仍将 seealso 显示为有效标注。

【问题讨论】:

  • 我认为@ShubhamNaik 是对的。请参阅也对我有用。
  • @Jevon718 你使用什么 Xcode 版本(构建)?仍然不适合我。
  • 我使用的是 Xcode 9.2; - seealso:- seeAlso:- SeeAlso: 都不适用于选项单击。不过,所有这些都在代码中突出显示为“文档标记关键字”。
  • 这在 Xcode 10.1 中仍然是一个问题,所有 - seealso:- seeAlso:- SeeAlso: 在评论中都得到 highlighted,但都不能用作文档(当 alt -点击)
  • @Neph:在 Xcode 11 beta 4 中仍然是一个问题。

标签: ios swift3 xcode8 code-documentation


【解决方案1】:

(XCode 11,Swift 5)

为了澄清这个问题,XCode 似乎可以识别文档 cmets 中的降价。如果你有类似的东西:

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

它被记录为:

我不知道这是否像 @seealso 那样挂钩到文档关键字,因为 # 降价标签只是指一个标题样式。为了证明这一点,您可以使用# 标签将任意部分添加到您的文档中:

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

获取记录为:

【讨论】:

    【解决方案2】:

    seealso 替换为# Reference

    【讨论】:

    • @Sajjon 代替 - SeeAlso: [Title](link) 使用 # Reference \n [Title](link)
    • 使用#Reference,Xcode不显示包含的链接
    • @KIO,确实如此,但前提是您在 Reference 之后有一个换行符。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-10-14
    • 2011-02-21
    • 1970-01-01
    • 1970-01-01
    • 2011-08-30
    • 1970-01-01
    • 2014-11-30
    相关资源
    最近更新 更多