3

I have a while looking for a way to generate docs for the functions in Xcode automatically using Swift.

I know how to generate it manually line-for-line but at least for me , is nasty the way to do it, you have to specify everything manually and this cost time.

You have to specify each parameter with :param: and its name follow it, and the return of the function with :returns:, all by your hand.

In PHP, for example that use a notation like Swift, you can type above your function /** and then press the Enter key and it completes the doc for the function, you have only to enter the details for each parameters and the description for the function. In my humble opinion it resume part of the job of comment your code.

I tried to find shortcuts key, snippets for doing this, but I don't find anything. I would like to know if there is a way to do it in Xcode using Swift at least. Any advice is very appreciated.

Victor Sigler
  • 23,243
  • 14
  • 88
  • 105

1 Answers1

3

After I continued my research I found a really excellent documentation generator for Swift and Objective-C also, named VVDocumenter-Xcode.

It's really easy to use , just type /// inside your function like in C# and magic happens, it automatically generates the Javadoc style for the function.

I strongly recommend installing the plug-in using the package manager Alcatraz

Completely compatible with Xcode 6+.

I hope this helps someone.

Victor Sigler
  • 23,243
  • 14
  • 88
  • 105