3

Since XCode 5 now supports reading header comments directly from header files, it has become increasingly interesting, to document functionality in a consistent way.

I therefore try to find a tool that can automatically insert header doc comments in Objective C header files, but can't seem to find one?

Basically I would like a took that could write something like:

/*!
    <desc method.>
    @param parmA
        <desc of parmA>
    @param parmB
        <desc of parmB>
    @result
        <desc of result>
 */
- (CO2 *)doSomething:(typeName)parmA withSomething:(typeName)parmB;
EsbenB
  • 3,356
  • 25
  • 44

1 Answers1

10

I found this very handy Xcode plugin to write all the default comment code for you.

https://github.com/onevcat/VVDocumenter-Xcode

EDIT

As of Xcode 8, there is a new shortcut available that has the same behaviour as the VVDocumenter plugin.

Place the cursor above any function, class, struct,... and hit ⌘ + ⌥ + /

This will generate a comment accordingly to where you placed the cursor.

Thomas Keuleers
  • 6,075
  • 2
  • 32
  • 35
  • Seems like the perfect solution! However I can't make it work. Instead of inserting a comment it seems to simply insert whatever I have in my clipboard. Did you manage to make it work? – EsbenB Sep 25 '13 at 11:44
  • 1
    Yes, you should download the master branch, build the VVDocumenter-Xcode target and restart Xcode after that. This worked for me. – Thomas Keuleers Sep 25 '13 at 11:51
  • ahh I found out that another tool I'm using (cut/paste files) was causing the problems. Seems like an excellent tool! Thanx – EsbenB Sep 25 '13 at 12:09