Swift annotation "tag"
The - Tag:
annotation is used to locate specific places of your own code. You can include it as part of symbols documentation in Swift. E.g. you may add a Tag
marker in some Swift file next to a function:
/// - Tag: myFunction
func myFunction() {
print("My function is called")
}
In another file you can refer to this exact place in the code as part of another Swift entity documentation:
/// Uses [myFunction](x-source-tag://myFunction) internally
func anotherFunction() {
myFunction()
}
When using the Quick Help popover on anotherFunction
in Xcode, you get an interactive reference (under myFunction text), which takes you to the file (and line) where the /// - Tag: myFunction
is located: