Xcode 8.2.1 未显示有关自动完成的文档说明 [英] Xcode 8.2.1 not showing documentation description on autocomplete

查看:21
本文介绍了Xcode 8.2.1 未显示有关自动完成的文档说明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Xcode 8.2.1 中向我的代码添加文档时遇到问题.

I'm having problems adding documentation to my code in Xcode 8.2.1.

这是我的代码:

/// Test documentation method
///
/// - Parameter string: The input string
/// - Returns: The output bool
func testMethod(string:String) -> Bool {

    if string == "YES" {
        return true
    }

    return false
}

文档在快速帮助窗口中按预期显示,但描述未在代码自动完成窗口中显示.

The documentation shows as expected in the quick help window but the description doesn't show in the code autocomplete window.

有没有办法让描述显示在自动完成框中,如下图所示:

Is there a way to get the description to show in the autocomplete box as in the image below:

推荐答案

您说得对,您添加到方法和属性顶部的描述不再出现在弹出窗口中.

You are right, the descriptions you added to the top of your methods and properties don't appear in the popover anymore.

如前所述,你只能看到苹果自己的方法和属性的描述.
原因是 Xcode 不会从它们的类中解析这些,而是​​从单独的文档集(您可以在 Xcode 的 Help/Documentation and API reference 选项卡中找到).

As noted, you can only see the descriptions of Apple's own methods and properties.
The reason being that Xcode doesn't parse these from their classes but rather from a separate documentation set (which you can find in Xcode's Help/Documentation and API reference tab).

因此,除非 Apple 决定改变这一点,否则恐怕无法在弹出窗口中看到您自己的.

So unless Apple decides to change this, I'm afraid it won't be possible to see your own in the popover.

您可以关注现有的文档集生成器(AppleDocJazzy),也许他们会提供一种方法将他们的文档链接到 Xcode 的 popover.

You could keep an eye on existing doc set generators (AppleDoc, Jazzy), maybe they'll offer a way to link their documentation to Xcode's popover.

请记住,在方法或属性上使用 alt + 单击 打开快速帮助弹出窗口时,您确实会看到自己的评论.

Keep in mind that you do see your own comments when opening the quick help popover with alt + click on a method or property.

这篇关于Xcode 8.2.1 未显示有关自动完成的文档说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆