【问题标题】:How to indent documentation in appledoc/HeaderDoc (for documentation on blocks that take arguements)如何在 appledoc/HeaderDoc 中缩进文档(关于带有争论的块的文档)
【发布时间】: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;

但显然这只会在文档中出现:

如何让 datafields 像 Apple 的方法一样缩进,该方法采用带参数的块?

我在 Apple's documentation on HeaderDoc 中找不到如何执行此操作

【问题讨论】:

  • 嘿蒂姆,你找到方法了吗?
  • @Emanuel 不幸的是,我从来没有为 Objective-C 弄清楚它,但是我确实找到了如何在 Swift 中完成类似的事情。 Swift 的文档在缩进方面比 Obj-C 中的更灵活。 nshipster.com/swift-documentation

标签: ios objective-c swift appledoc headerdoc


【解决方案1】:

你可以使用:

@param block My block with the following parameters: 
<table>
<tr>
  <td><tt>myParam</tt></td>
  <td>Description</td>
</tr>
</table>

【讨论】:

  • 至少这对我来说在 Xcode 中合理地格式化了它。
  • 哇,不知道为什么我花了这么长时间才意识到你可以这样格式化。谢谢!我将不得不尝试使用外部生成的文档来查看它是否保留了格式。我想会的。
猜你喜欢
  • 2012-04-23
  • 2015-02-22
  • 1970-01-01
  • 1970-01-01
  • 2012-04-06
  • 2014-11-21
  • 1970-01-01
  • 2014-09-26
  • 2011-03-11
相关资源
最近更新 更多