Skip to content

Commit f1da7a9

Browse files
drumnkylecezarywojcik
authored andcommitted
Added more info to parameter documentation syntax (#14)
* Added more info to parameter documentation syntax * Remove trailing whitespace
1 parent 083775a commit f1da7a9

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,22 @@ Guidelines:
961961

962962
* **4.1.3** Do not prefix each additional line with a `*`.
963963

964-
* **4.1.4** Use the new `- parameter` syntax as opposed to the old `:param:` syntax (make sure to use lower case `parameter` and not `Parameter`). See [the documentation on Swift Markup](https://developer.apple.com/library/watchos/documentation/Xcode/Reference/xcode_markup_formatting_ref/) for more details on how this is formatted.
964+
* **4.1.4** Use the new `- parameter` syntax as opposed to the old `:param:` syntax (make sure to use lower case `parameter` and not `Parameter`). Option-click on a method you wrote to make sure the quick help looks correct. See [the documentation on Swift Markup](https://developer.apple.com/library/watchos/documentation/Xcode/Reference/xcode_markup_formatting_ref/) for more details on how this is formatted.
965+
966+
```swift
967+
class Human {
968+
/**
969+
This method feeds a certain food to a person.
970+
971+
- parameter food: The food you want to be eaten.
972+
- parameter person: The person who should eat the food.
973+
- returns: True if the food was eaten by the person; false otherwise.
974+
*/
975+
func feed(_ food: Food, to person: Human) -> Bool {
976+
// ...
977+
}
978+
}
979+
```
965980

966981
* **4.1.5** If you’re going to be documenting the parameters/returns/throws of a method, document all of them, even if some of the documentation ends up being somewhat repetitive (this is preferable to having the documentation look incomplete). Sometimes, if only a single parameter warrants documentation, it might be better to just mention it in the description instead.
967982

0 commit comments

Comments
 (0)