What is the markup format for documentation on the parameters of a block in Swift?

后端 未结 1 730
独厮守ぢ
独厮守ぢ 2021-02-15 18:01

The parameters of a block in Swift shows up with a table for parameters of the block if you add markup for documentation but I can not figure out how to fill out this table. I h

相关标签:
1条回答
  • 2021-02-15 18:23

    You have to give a name to the parameter, but precede it with an underscore:

    /**
     Foo
    
     - parameter completion: A block to execute
     - parameter aflag: Some Bool flag
     */
    func foo(completion: (_ aflag: Bool) -> Void) {
        // do something
    }
    

    0 讨论(0)
提交回复
热议问题