Jun 17, 2013

Xcode 5 - comment for documentation

New feature of Xcode 5. You can document your own code as like the below:

/*! Add new message between source to destination timeline as empty name string
 * \param sourceId Source timeline entity ID
 * \param destId Destination timeline entity ID
 * \returns A newly created message instance
 */
- (ISMessage*)messageFromTimeline:(NSInteger)sourceId toTimeline:(NSInteger)destId;

You can use Doxygen format for documentation. Then you can see the documentation of this function from Xcode 5 UI as like the below (by using Quick Help or Option-Click). 



Very easy! The following comment styles are also possible.

/** 
 * Add new message between source to destination timeline as empty name string
 * @author Wonil Kim
 *
 * @param sourceId Source timeline entity ID
 * @param destId Destination timeline entity ID
 * @return A newly created message instance
 */
- (ISMessage*)messageFromTimeline:(NSInteger)sourceId toTimeline:(NSInteger)destId;

/// Add new message between source to destination timeline
///
/// @param sourceId Source timeline entity ID
/// @param destId Destination timeline entity ID
/// @param name Message name
/// @return A newly created message instance
- (ISMessage*)messageFromTimeline:(NSInteger)sourceId toTimeline:(NSInteger)destId withName:(NSString*)name;

Property documentation is also possible.

/// Minimum height of entity for layout calculation

3 comments:

  1. Who cares about the NDA anyway ;)

    ReplyDelete
  2. i like your post thank's for your information its very useful for me ^___^

    ReplyDelete
  3. Not sure why, but this isn't working for me. . . interestingly, the old .docset approach of installing docs has stopped working too. .

    a) I can install Appledoc docsets to Xcode5
    b) Doxygen docsets aren't working for me in Xcode5 .

    ReplyDelete