Much like JavaDoc, there is a markup language available for “SwiftDoc” to provide documentation for your own functions. You can see some examples here and below as well:
/// This function returns a *hello* string for a given `subject`.
///
/// - Warning: The returned string is not localized.
///
/// Usage:
///
/// println(hello("Markdown")) // Hello, Markdown!
///
/// - Parameter subject: The subject to be welcomed.
///
/// - Returns: A hello string to the `subject`.
Check out Apple’s full documentation here.