Does Swift have documentation generation support?

前端 未结 12 1496
伪装坚强ぢ
伪装坚强ぢ 2020-11-28 00:15

Many languages support documentation comments to allow a generator (like javadoc or doxygen) to generate code documentation by parsing that sam

12条回答
  •  天命终不由人
    2020-11-28 00:44

    New in Xcode 8, you can select a method like this

    func foo(bar: Int) -> String { ... }
    

    Then press command + option + / or choose "Structure" - "Add documentation" from Xcode's "Editor" menu, and it will generate the following comments template for you:

    /// <#Description#>
    ///
    /// - parameter bar: <#bar description#>
    ///
    /// - returns: <#return value description#>
    

提交回复
热议问题