How can I force Xcode to show my own documentation for custom classes, methods, etc.? I'm used to Java and Eclipse, which shows me documentation for my classes as shown here:
How can I achieve the same in Xcode? Are there special comments that Xcode can recognize and display?
As of Xcode 5.0, Doxygen and HeaderDoc formatting for variables and methods is automatically parsed and rendered in the Quick Help popover. More information about it here, but here's some key bits:
/** * Add a data point to the data source. * (Removes the oldest data point if the data source contains kMaxDataPoints objects.) * * @param aDataPoint An instance of ABCDataPoint. * @return The oldest data point, if any. */ - (ABCDataPoint *)addDataToDataSource:(ABCDataPoint *)aDataPoint;
renders in Xcode as:
As for properties, it's as easy as:
/// Base64-encoded data. @property (nonatomic, strong) NSData *data;
When option-clicked, this lovely popover appears:
Well, it seems that for the classes the question hasn't still been answered, so I'll post my suggestions.
Just before the @interface MyClass : NSObject
line in the MyClass.h file you use the comment like you did in your example, but adding some tags to display the text. For example the code below:
/** * @class GenericCell * @author Average Joe * @date 25/11/13 * * @version 1.0 * * @discussion This class is used for the generic lists */
will produce the following output: the output of the code above http://imageshack.com/a/img18/2194/kdi0.png
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With