Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode code completion custom descriptions

Tags:

xcode

ios

xcode9

For some methods, Xcode's code completion / suggestion / auto-complete feature displays descriptions:

description shown in code completion

When I create classes, functions, variables, and what not and do provide descriptions, the description does not show up:

description of custom function **not** showing

However, in the quick help menu on the right hand side, and when clicking alt+click, it does:

description in quick menu works

I tried this "solution", but it did not work. Is there any special characters I need to include in the description?

Note

I am currently on Xcode 9 beta 1, but I also experienced this issue in Xcode 8.

Update

Glad to say that it now works for me in Xcode 9 GM.

like image 270
LinusGeffarth Avatar asked Oct 18 '22 10:10

LinusGeffarth


1 Answers

I think the reason might be that there is no space after ///.
Right way should be

/// This is a description

As a matter of fact, if you add documentation for a function as mentioned in screenshot, comments are itself added wherein you can see that space is there after ///. Which is intact the right way to add comments/documentation.
Once you option click on the function calling, description is displayed.
The way Apple displays the description in autocomplete is something it does by itself. You may want to use AppleDoc for this.

enter image description here

like image 136
Nitish Avatar answered Oct 20 '22 22:10

Nitish