3

I created a method that has a block as a parameter. The block takes some arguments, so I would like to indent the documentation like Apple does in their methods that have a similar format...

enter image description here

An simple example how this would look in code is:

/** 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;

But clearly this will only appear like this in the documentation:

enter image description here

How do I get data and fields to appear indented like Apple's method that takes a block with arguments?

I couldn't find how to do this in Apple's documentation on HeaderDoc

timgcarlson
  • 3,017
  • 25
  • 52
  • Hey Tim, Did you find how to do it? – Emanuel Feb 10 '16 at 17:52
  • @Emanuel Unfortunately I never did figure it out for Objective-C, however I did find out how to accomplish something similar in Swift. Swift's documentation allows for more flexibility when it comes to indenting than what is in Obj-C. http://nshipster.com/swift-documentation/ – timgcarlson Feb 10 '16 at 18:19

1 Answers1

2

You can use:

@param block My block with the following parameters: 
<table>
<tr>
  <td><tt>myParam</tt></td>
  <td>Description</td>
</tr>
</table>
Jason Bobier
  • 332
  • 2
  • 6
  • At least this formats it reasonably in Xcode for me. – Jason Bobier Feb 25 '16 at 00:27
  • Wow, not sure why it took me so long to realize you can format this way. Thanks! I'm going to have to try this with externally generated documentation to see if it retains the formatting. I assume it will. – timgcarlson Feb 25 '16 at 17:06