Many languages support documentation comments to allow a generator (like javadoc or doxygen) to generate code documentation by parsing that sam
javadoc
Jazzy can help to generate beautiful apple styled documentation. Here is a sample app with details on how to use and configure quickly.
https://github.com/SumitKr88/SwiftDocumentationUsingJazzy