I'm aware of Doxygen to generate the documentation. What I'm looking for is quick way to insert documentation in Xcode similar to what Eclipse does when editing Java files.
Let's say I have an objective-c method with a couple of arguments like this:
-(NSInteger*) sumOf: (NSInteger*) one and:(NSInteger*) two {...
In Eclipse, if you place the cursor above the method and type: /**<Enter>
you get a Javadoc template pre-populated with @param
and @return
tags.
Is it possible to achieve something similar in Xcode? After typing /**<Enter>
, I'd like to get this automatically:
/**
*
* @param one
* @param two
*
* @return
*/
-(NSInteger*) sumOf: (NSInteger*) one and:(NSInteger*) two {...
The script here http://www.duckrowing.com/2011/05/14/using-the-doxygen-helper-in-xcode-4/ does exactly what you want.
EDIT: Here is an updated version of the Script: https://github.com/premosystems/DoxygenXCodeHelper
I have been using VVDocumenter-Xcode successfully in Xcode 5 and it works well. It automatically generates a template specific to a method when you enter "///" above the method.
The "User Scripts" menu (that little black scroll icon in Xcode's menu bar) has a HeaderDoc submenu with templates for all sorts of documentation markup in HD syntax. You can set a keyboard shortcut for the items you want to use by going to "Key Bindings" in Xcode's "Preferences" window.
Since User Scripts are essentially shell scripts, you can use any scripting language to write your own, so if you wanted you could even write a little regex-aided script that parses the parameter names out of the selected line and fills out the basics of your HeaderDoc comment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With