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;

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

3 Comments

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?
Yes, you should download the master branch, build the VVDocumenter-Xcode target and restart Xcode after that. This worked for me.
ahh I found out that another tool I'm using (cut/paste files) was causing the problems. Seems like an excellent tool! Thanx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.