Question:
- What is the correct format to add documentation (using built in functionality not 3rd party) to a custom
Swift
closure inXcode 8
? - Could you provide the Apple documentation link to refer ?
- How to specify the
closure
parameters
? - How to specify the
closure
return type
?
Example:
struct S1 {
/// This block is executed after completion
var completion : (String, Int) -> (Bool)
}
Note:
Xcode 8
has built in functionality to add documentation to custom code.
This can be done, by doing one of the following:
Command
+Option
+Click
on codeKeep cursor on code and
Editor
>Structure
>Add documentation
Reference:
Workaround:
If those tags are not supported for the given location the only possible workaround seems to be right now: