Created by Noor ul Ain Ali on 13/02/2021.
/**
The area of the `Shape` instance.
Computation depends on the shape of the instance.
For a triangle, `area` is equivalent to:
let height = triangle.calculateHeight()
let area = triangle.base * height / 2
*/
var area: CGFloat { get { return 5 } }
/**
The perimeter of the `Shape` instance.
Computation depends on the shape of the instance, and is
equivalent to:
~~~
// Circles:
let perimeter = circle.radius * 2 * Float.pi
// Other shapes:
let perimeter = shape.sides.map { $0.length }
.reduce(0, +)
~~~
*/
var perimeter: CGFloat { get { return 5 } }
/**
# Lists
You can apply *italic*, **bold**, or `code` inline styles.
## Unordered Lists
- Lists are great,
- but perhaps don't nest;
- Sub-list formatting...
- ...isn't the best.
## Ordered Lists
1. Ordered lists, too,
2. for things that are sorted;
3. Arabic numerals
4. are the only kind supported.
*/
func thisIsFirstMethod() {
}
/**
Creates a personalized greeting for a recipient.
- Parameter recipient: The person being greeted.
- Throws: `MyError.invalidRecipient`
if `recipient` is "Noor"
(`host` cannot be `recipient`).
- Returns: A new string saying hello to `recipient`.
*/
func greeting(to recipient: String) throws -> String {
guard recipient != "Noor" else {
throw NSError(domain: "InvalidRecipient", code: 500, userInfo: nil)
}
return "Greetings, \(recipient)!"
}
/// Returns the magnitude of a vector in three dimensions
/// from the given components.
///
/// - Parameters:
/// - x: The *x* component of the vector.
/// - y: The *y* component of the vector.
/// - z: The **z** component of the vector.
func magnitude3D(x: Double, y: Double, z: Double) -> Double {
return sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2))
}
Adding simple autogenerated documentation comment from Xcode -> Editor -> Structure -> Add Documentation
/// This is autogenerated documentation for `newMethod`
func newMethod() {
}
Adding simple autogenerated documentation with parameter comment from Xcode -> Editor -> Structure -> Add Documentation
/// This is autogenerated with parameter
/// - Parameter inputValue: any string value
func newMethod(with inputValue: String) {
}
Adding simple autogenerated documentation with parameter & return from Xcode -> Editor -> Structure -> Add Documentation
/// This is autogenerated with parameter & return value
/// - Parameter inputValue: any string value
/// - Returns: same as inputValue
func newMethod(with inputValue: String) -> String {
return inputValue
}
/**
Additional fields
- Callout: Add Callout description that you can use
- Attention: ...
- Author: ...
- Authors: ...
- Bug: ...
- Complexity: ...
- Copyright: ...
- Date: ...
- Experiment: ...
- Important: ...
- Invariant: ...
- Note: ...
- Postcondition: ...
- Precondition: ...
- Remark: ...
- Requires: ...
- See: [Google link here](https://www.google.com) ...
- Since: ...
- Todo: ...
- Version: ...
- Warning: ...
*/
func extraFields() {
}
/**
Additional fields
- Callout: Add Callout description that you can use
- hi
- there
*/
func extraFields2() {
}
For more information regarding Markdown syntax, refer (this)[https://github.com/tchapi/markdown-cheatsheet/blob/master/README.md]