Swift standard documentation comment

前端 未结 5 1310
小鲜肉
小鲜肉 2020-12-31 06:18

Is there a standard way to write documentation comment in the Swift language? Something equivalent to javadoc (Java) or docstrings (Python)?

example:



        
5条回答
  •  温柔的废话
    2020-12-31 06:50

    Yes there is.

    Swift includes "///" comment handling (although probably not everything yet).

    Write something like:

    /// Hey!
    func bof(a: Int) {
    
    }
    

    Then option-click on the func name and voilà :)

提交回复
热议问题