Documentation/DocumentingCode.md
Please follow these guidelines when documenting code using Xcode's markup:
/// DO:
/// For the sake of the demonstration we will use the lorem ipsum text here.
/// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ullamcorper
/// tempor dolor a cras amet.
///
/// - returns: Cras a convallis dolor, sed pellentesque mi. Integer suscipit
/// fringilla turpis in bibendum volutpat.
/// ...
/// DON'T
/// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ullamcorper tempor dolor a cras amet.
///
/// - returns: Cras a convallis dolor, sed pellentesque mi. Integer suscipit fringilla turpis in bibendum volutpat.
/// ...
/// DON'T II
/// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ullamcorper
/// tempor dolor a cras amet.
///
/// - returns: Cras a convallis dolor, sed pellentesque mi. Integer suscipit
/// fringilla turpis in bibendum volutpat.
parameters delimiter instead of the parameter delimiter even if a function has only one parameter:/// DO:
/// - parameters:
/// - foo: Instance of `Foo`.
/// DON'T:
/// - parameter foo: Instance of `Foo`.
return delimiter to an initializer's markup:/// DO:
/// Initialises instance of `Foo` with given arguments.
init(withBar bar: Bar = Bar.defaultBar()) {
...
/// DON'T:
/// Initialises instance of `Foo` with given arguments.
///
/// - returns: Initialized `Foo` with default `Bar`
init(withBar bar: Bar = Bar.defaultBar()) {
...
/// DO:
/// - parameters:
/// - foo: A foo for the function.
/// ...
/// DON'T:
/// - parameters:
/// - foo: foo for the function;
parameters:/// DO:
/// - note: This is an amazing function.
///
/// - parameters:
/// - foo: Instance of `Foo`.
/// - bar: Instance of `Bar`.
///
/// - returns: Something magical.
/// ...
/// DON'T:
/// - note: Don't forget to breathe, it's important! 😎
/// - parameters:
/// - foo: Instance of `Foo`.
/// - bar: Instance of `Bar`.
/// - returns: Something claustrophobic.
/// DO:
/// Create instance of `Foo` by passing it `Bar`.
///
/// - parameters:
/// - bar: Instance of `Bar`.
/// ...
/// DON'T:
/// Create instance of Foo by passing it Bar.
///
/// - parameters:
/// - bar: Instance of Bar.
precondition, parameters and return delimiters should come last in that order in the markup block before the method's signature./// DO:
/// Create instance of `Foo` by passing it `Bar`.
///
/// - note: The `foo` is not retained by the receiver.
///
/// - parameters:
/// - foo: Instance of `Foo`.
init(foo: Foo) {
/* ... */
/// DON'T
/// Create counter that will count down from `number`.
///
/// - parameters:
/// - number: Number to count down from.
///
/// - precondition: `number` must be non-negative.
init(count: Int)
/// DO:
/// Do something magical and return pixie dust from `self`.
///
/// DON'T:
/// Does something magical and returns pixie dust from `self`.
return: delimiter./// DO:
/// - returns: A signal with mapped value over given function
///
/// DON'T:
/// - returns:
/// A signal with mapped value over given function