In addition to the above, here are a couple more quick tips: If you use the above syntax, this contextual menu will now work with your own types as well. This should be a hint to you that there’s minimal extra effort with huge benefits when writing documentation.Īdditionally, documenting the code this way not only makes Objective-C’s headers or Swift’s generated interfaces look really nice and professional, but it also augments your Xcode experience.įor example, have you tried Option-clicking a symbol in Xcode? You may have seen a little dialog that pops out with information related to the symbol you clicked on. As you can see, the difference between the comments and the documentation block’s syntax is small (one extra * for multiline blocks, and one extra / for one-line documentation blocks).