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

馋奶兔 提交于 2019-12-22 08:29:07

问题


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

Apple markup documentation of no help is here

more documentation from NSHipster that does not address the closure woe


回答1:


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

https://bugs.swift.org/browse/SR-3693 so my question seems to duplicate 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



来源:https://stackoverflow.com/questions/47675488/how-to-document-parameters-of-a-closure-thats-a-parameter

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!