【发布时间】:2015-04-14 22:37:06
【问题描述】:
我创建了一个以块为参数的方法。该块需要一些参数,因此我想像 Apple 在其具有相似格式的方法中那样缩进文档...
一个简单的例子如下:
/** Loads a project from web service.
@param securityKey The security key.
@param block The block to execute after the web service returned all data. The block takes five arguments:
@param data The data.
@param fields Some fields.
*/
- (void)loadProjectWithSecurityKey:(NSString *)securityKey andCompletion:(void(^)(NSDictionary *data, NSDictionary *fields))completion;
但显然这只会在文档中出现:
如何让 data 和 fields 像 Apple 的方法一样缩进,该方法采用带参数的块?
我在 Apple's documentation on HeaderDoc 中找不到如何执行此操作
【问题讨论】:
-
嘿蒂姆,你找到方法了吗?
-
@Emanuel 不幸的是,我从来没有为 Objective-C 弄清楚它,但是我确实找到了如何在 Swift 中完成类似的事情。 Swift 的文档在缩进方面比 Obj-C 中的更灵活。 nshipster.com/swift-documentation
标签: ios objective-c swift appledoc headerdoc