Some thing that looks like a comment but isn't a comment

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.


I am seriously confused.


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

1 Like

Thanks for your explanation!