Code completion markup

Hello,


I am do my function markup, in swift code, like apple documentation show, but when code completion of my function show, the description of the function don't show, why? I need install something in Xcode to show the custom documentation?


Thanks a lot.

Replies

In fact, a markup like


// MARK: - IBAction


has no effect on code completion.


So, to make sure I understand :

- you have defined a func such as :

func myFunc(param param: Int) {

}


When you start typing myF you should be proposed immediately myFunc(param param: Int)

But when you type its name in code, you don't see the proposal for the signature ?


Is that the problem you have ?

You can try to clean the build forlder : option-click in Menu 'Product', then select Clean Build Folder.

I think raffaelpatricio is asking why, given code like this:

/// Sings a silly song.
///
/// Some more text about this meaningless function.
///
/// - Parameter count: The number of times to sing.

func zipityDoDah(count: Int) {
    // nothing
}

doing the following doesn’t work:

  1. Typing “zip”

  2. Hitting code completion

  3. You get a nice summary for the

    zip(_:_:)
    function
  4. Down arrow to the

    zipityDoDah(count:)
    function
  5. You don’t get nice summary for that

Alas, I’m not sure why that is. Looking at the

zip(_:_:)
code in the standard library I don’t see it doing anything special to enable the summary.

My recommendation: file a bug report about this. Even if there is a way to make it work, it’s a bug that it’s not covered in the Markup Formatting Reference.

ps Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

WWDC runs Mon, 5 Jun through to Fri, 9 Jun. During that time all of DTS will be at the conference, helping folks out face-to-face. http://developer.apple.com/wwdc/

Possibly wrong markup?


In order for description to show up, you need to type


/// My description


right above the class/method you are annotating. Is that what you are doing? Can you post some examples?

Hi,


I tested your example.

Step 1 to 3 behave as explained.


But what is step 4 ? How can I "Down arrow to the

zipityDoDah(count:)
function"

[No screen shot support. grumble OK, time for some legendary ASCII art (-: ]

At step 3 this is what I see:

zip
 +------------------------------------------------------------------------------------+
>| [f] Zip2Sequence<Sequence, Sequence> zip(sequence1: Sequence, sequence2: Sequence) |<
 | [f]                             Void zipityDoDah(count: Int)                       |
 | [S]                     Zip2Iterator Zip2Iterator                                  |
 | [S]                     Zip2Sequence Zip2Sequence                                  |
 | …                                                                                  |
 +------------------------------------------------------------------------------------+
 | Creates a sequence of pairs built out of two underlying sequences.                 |
 +------------------------------------------------------------------------------------?

The first line is selected, as denoted by the

> … <
, and the summary text for the
zip(_:_:)
method is shown in the box at the bottom.

Now, if I hit the down arrow on the keyboard the second line gets selected and this is what I see:

zip
 +------------------------------------------------------------------------------------+
 | [f] Zip2Sequence<Sequence, Sequence> zip(sequence1: Sequence, sequence2: Sequence) |
>| [f]                             Void zipityDoDah(count: Int)                       |<
 | [S]                     Zip2Iterator Zip2Iterator                                  |
 | [S]                     Zip2Sequence Zip2Sequence                                  |
 | …                                                                                  |
 +------------------------------------------------------------------------------------+

Note that the summary box has disappeared.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

WWDC runs Mon, 5 Jun through to Fri, 9 Jun. During that time all of DTS will be at the conference, helping folks out face-to-face. http://developer.apple.com/wwdc/

Thanks Quinn for this great ASCII art.

I tested on XCode 7.3: it works, I get "Sings a silly song." message

Tested on XCode 8.3.2, doesn't work.


So a regression bug somewhere.


BTW, can we expect some day to post images on the forum ? Maybe the question will be asked at WWDC ?

BTW, can we expect some day to post images on the forum ?

I’ve tried to get this enabled previously but I think it’s worth trying again (INC064217489).

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

WWDC runs Mon, 5 Jun through to Fri, 9 Jun. During that time all of DTS will be at the conference, helping folks out face-to-face. http://developer.apple.com/wwdc/