

Summary – Documentation that is pleasant to read in Swift If anyone can make it work, just leave a comment below! It’s curious and would be very good to be able to do that but I couldn’t get it to work properly. It seems broken in my Xcode build 12.5 and the new beta also seems to not work but Apple says that is possible to insert images in playgrounds documentations. Resulting in the white horizontal rule line here: This is above the horizontal rule, and will be the *dicussion section* for the algortithm.įunc sumValues(x: Int, y: ) throws -> Int? This is function **sum the X value with all the Y values**

And finally, documentation is your friend and tool so use it in the right situations. The second disclaimer is to try to express yourself in your code, and use Swift’s documentation API for everything that isn’t possible with a good naming or the naming would be too big/weird. The first one is that no matter how good your documentation is your actual API and language feature implementations should always come first when reasoning about your code. There are some disclaimers that we should do before starting this journey on documentation. A very important part of every developer’s day-to-day life is to write code that anyone will understand, especially because maybe you will be reading your code in the future and you sure want that you can reason about it. Today we will explore a little further into how can you be more descriptive in your Swift code.
Swift code documentation how to#
The topic today is how to create documentation that is pleasant to read in Swift and help others to interact better with your code.
