glv19
glv19

Reputation: 486

Xcode 8.2.1 not showing documentation description on autocomplete

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

Here's my code:

/// 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.

enter image description here

enter image description here

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

enter image description here

Upvotes: 9

Views: 2828

Answers (3)

Thomas
Thomas

Reputation: 2063

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

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).

So unless Apple decides to change this, I'm afraid it won't be possible to see your own in the 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.

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

Upvotes: 4

C-Viorel
C-Viorel

Reputation: 1866

For me the best way to resolve this is by cleaning the project Shift+Command+K, and if that is not working, it is a god idea to remove Derived Data folder.

To remove this folder go to Xcode preferences, Locations tabDerived Data folder location

and click on the small arrow to open a finder, and remove manually the folder.

Restart Xcode, and check if now is working

Upvotes: 1

Related Questions