Alex Rivera | Logout

What are documentation comments in Xcode?

Asked 2011-07-07T03:38:52.290
27

This question is for reference purposes.

In the "Fonts & Colors" tab of the Settings window of Xcode, there's a setting for documentation comments (and keywords)? What are they?

Edit
Report

1 Answer

7

There are a number of tools such as Doxygen, Javadoc, and others which recognize "special" comments (known as documentation comments) to automatically generate documentation for the code.

Typically, documentation comments start with a special sequence such as /** (as opposed to just /*) and contain special keywords that often have a special start symbol such as @. There are a lot of similarities between the different comment documentation generators, most of which accept "@param" to document parameters, "@return" to document return values, "@throws" to document exceptions, etc.

In the context of Xcode's syntax highlighting, documentation comments are those with one of these special start sequences that Xcode happens to recognize. It should be noted that there a specific set of such comments that Xcode properly recognizes; for example, the Doxygen tool also allows /*! and //! (with an exclamation) to indicate the start of documentation comments, but Xcode doesn't recognize it.

answered 2011-07-07T03:49:27.993

Your Answer