Anton Tropashko
Anton Tropashko

Reputation: 5806

How to document parameters of a closure that's a parameter

My attempt at documenting a closure parameter to a function:

/**
    sends the request out.

    - Parameter pzurl: request description including url, method, formdata.
 - Parameter responseProcessor: closure that's on success invokes
 - Parameter json: a json array or dictionary
 - Parameter timestamp: and the same `timestamp` that this function returns
 - parameter failure: closure is invoked when json could not be parsed or remote indicated failure
 - Returns: timestamp to identify responses
 */
internal static func processPZURL(pzurl: PZURL,
                                  responseProcessor:@escaping (_ json:JSON, _ timestamp: TimeInterval) -> (), failure:@escaping (PZError) -> ()) -> TimeInterval {

yields "No description"

and I can find no description of how to change that

enter image description here

Apple markup documentation of no help is here

more documentation from NSHipster that does not address the closure woe

Upvotes: 5

Views: 724

Answers (1)

Anton Tropashko
Anton Tropashko

Reputation: 5806

Apparently this is broken ever since january 2017 (or never worked in any xcode) per this:

https://bugs.swift.org/browse/SR-3693 so my question seems to be an up to date version of How do you document the parameters of a function's closure parameter in Swift 3?

except answer in that question does not work in xcode 9.2

filed 35881586 with apple

Upvotes: 3

Related Questions