如何记录作为参数的闭包的参数 [英] 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 {
产生没有描述"
我找不到如何更改它的描述
and I can find no description of how to change that
更多来自NSHipster的文档,这些文档都没有解决闭包问题
推荐答案
显然,自今年1月以来,此问题已被打破(或从未在任何xcode中工作过):
Apparently this is broken ever since january this year (or never worked in any xcode) per this:
https://bugs.swift.org/browse/SR-3693 所以我的问题似乎重复了 您如何记录Swift 3中函数的关闭参数的参数?
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?
该问题的答案除外,在xcode 9.2中不起作用
except answer in that question does not work in xcode 9.2
向苹果提交35881586
filed 35881586 with apple
这篇关于如何记录作为参数的闭包的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文