Skip to content

Instantly share code, notes, and snippets.

@RameshThota87
Last active September 4, 2016 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RameshThota87/129fba095e76d44f6c876445aa21201e to your computer and use it in GitHub Desktop.
Save RameshThota87/129fba095e76d44f6c876445aa21201e to your computer and use it in GitHub Desktop.
In .h file
====================================
Viewcontroller Class documentation
====================================
/*!
@header ViewController.h
@brief <#This is the header file where my super-code is contained.#>
<#This file contains the most importnant method and properties decalaration. It's parted by two methods in total, which can be used to perform temperature conversions.#>
@author <#Your_Name#>
@copyright <#2016 Your_Name#>
@version <#15.12.7#>
*/
==========================
Protocol documentaion
==========================
/*!
@protocol <#ViewControllerDelegate#>
@brief <#The ViewControllerDelegate protocol#>
<#It's a protocol used as a demo here. In a real application it would be quite useful.#>
*/
@protocol ViewControllerDelegate
/*!
Nothing to say here... Just testing documentation.
*/
-(void)thisIsADelegateMethod;
@end
===============================
Prorperty documentation
===============================
//Use the below comment for explaining the property or variables.
/*!
* Specifies the sampleString used to define the strings.
*/
@property (nonatomic, strong) NSString *sampleString;
==========================
Class documentation
==========================
/*!
@class <#ViewController#>
@brief <#The ViewController class.#>
@discussion <#This class was designed and implemented to help people covert temperatures between the Fahrenheit and Celsius scales.#>
@superclass SuperClass: <#UIViewController#>
@classdesign <# No special design is applied here.#>
@coclass <#AppDelegate#>
@helps <#It helps no other classes.#>
@helper <#No helper exists for this class.#>
*/
=============================
Defining Structs and Enums
=============================
/*!
@typedef <#WeatherConditionsInDays#>
@brief <#A struct about the weather.#>
@discussion
<#The values of this structure represent how many sunny, cloudy, rainy, and snowy days existed over the last year. If this was a real app, they could be perfectly used.#>
@field <#sun#> <#Good weather#>
@field <#clouds#> <# Where's the sun?#>
@field <#rain#> <#Get an umbrella#>
@field <#snow#> <#Watch out... A snowball is coming!#>
*/
typedef struct {
/*! Good weather */
int sun;
/*! At least it's not raining */
int clouds;
/*! Don't forget to get your umbrella */
int rain;
/*! Time to go skiiiiiing */
int snow;
} WeatherConditionsInDays;
==========================
Method documentation
==========================
/**-----------------------------------------------------------------------------
* @name Accessing the anotherTest
* -----------------------------------------------------------------------------
*/
/*!
* @brief: <#write a short description about the method, property, class, file, struct, or enum you’re documenting. No line breaks are allowed.#>
* @discussion: <#Use it to write a thorough description.#>
* @see <#Sample URLfor more information.#>
* @param <#Method or function Parameter desction#>
* @param <#[param]#> <#[Description] #>
* Example usage:
* @code
<#Sample Code#>
* @endcode
* @return <#Return type description. Example YES if the timestamp of @c thatURL is newer than the timestamp of @c thisURL,otherwise NO.#>
* @warning <#[description]: Call out exceptional or potentially dangerous behavior#>
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment