

Not exactly a viral app, but it serves our purpose for adding documentation. Example Timeįor this example I have created a very simple one screen application with one button, one text entry field, and one display label. Let’s try and example and see how this all works for our benefit.

The names should explain their purpose, for example, we can put an author name in function documentation so we know who wrote it along with a version number. There is a system of keywords than can be used to highlight particular parts of our code like parameters and returns. Working through the example below will help demonstrate this. Once you have documented code it will appear in the quick help inspector panel and in the code editor.
#Swift code documentation how to
Apple also has a reference document that you can read to understand which tags are supported and how to use them, I will not go over the markdown language specifics in this article. To take full advantage of rich documentation you need to understand at least the basics of Markdown. If your are writing API’s that will be used by other developers, documentation is a must! This enables us to better share code with team members, or refer back in the future to what something does and why. We can use this feature to document classes, functions, parameters, literally anything that we feel needs to be explained or referenced. Using Markdown, we can write structured documents that are both accessible right within Xcode’s Editor and as standalone documentation. Xcode 7 onwards gave us the ability to document our code beyond just simple comments.
