I know comments are written like // This is a comment
but I recently ran into this /// what is this
that makes the text turn into something like plain text and greys out the triple-forward slash.
Image:
I am seriously confused.
Ben
I know comments are written like // This is a comment
but I recently ran into this /// what is this
that makes the text turn into something like plain text and greys out the triple-forward slash.
Image:
I am seriously confused.
Ben
It’s a way to include Markdown-formatted documentation in your code. Use of ///
for inline comments or /** ... */
for block comments indicates the included text is formatted as Markdown. Your documentation will show just like Apple’s does when you option-click on a method or whatever.
There is a lot you can do with this. For more info, check out this NSHipster post: Swift Documentation
Thanks for your explanation!