Documenting in Xcode with HeaderDoc Tutorial

Learn how to automatically generate HTML documentation for your iOS code using HeaderDoc. By Andy Pereira.

Leave a rating/review
Save for later
Share
You are currently viewing page 4 of 4 of this article. Click here to view the first page.

VVDocumenter-Xcode

Last up in our roundup of documentation tips is VVDocumenter-Xcode, a third party Xcode plugin that will make documenting even easier than using the Code Snippet you created earlier.

To get started, download the plugin from Github.

All you need to do is open the project, and build. As it builds, it will automatically install the plugin for you in your ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins directory.

Once it finishes, restart Xcode, and open your DocumentationExamples project if it is not already open. In MathAPI.h delete the entire comment block for addNumber:toNumber:. Now, type the following above the method declaration:

///

Once you do, VVDocumenter-Xcode will automatically create a comment block with all of the necessary @param tags, with autocomplete tokens between all necessary fields.

RW_Documentation_VVDocumentor

Convenient, eh?

Now, go to Car.h and delete all of your comments for the CarType NS_ENUM, even the comments for each constant. Above the NS_ENUM declaration, type:

///

This time, it created the discussion section above the enum, and even put the necessary comments above each constant!

VVDocumenter-Xcode can make your life so much easier. If you want to customize VVDocumenter-Xcode, in Xcode, go to Window>VVDocumenter.

VW_Documentation_VVDocPrefs

Here, you can change the autocomplete keyword, the comment style, and more. Feel free to customize it however you’d like. I’ve found it saves a ton of time.

Where To Go From Here?

You can download the finished project from this HeaderDoc tutorial here.

As a challenge, go through some of your own code, and create documentation for yourself. Try using the code snippet you made, and VVDocumentor. See what fits your style, and how you can work it in to your workflow.

Also, be sure to check out Appple’s HeaderDoc User Guide for more information now that you know the basics.

If you have any questions or comments on this tutorial, please join the discussion below!