11

Assume I have two classes:

/**
  This class should be used together with [Foo]( ??? ).
*/
class Bar {
    func doNothing() {}
}

/**
  Description of what Foo does goes here.
*/
class Foo {
    func doNothing() {}
}

I want to create a link to Foo or Foo's quick help from Bar's quick help in Xcode. Is it even possible? If so, how?

The [name](target) syntax for links isn't up to snuff as far as I can tell by looking at Apple's docs and more Apple's docs.

Cybotaur
  • 138
  • 1
  • 7

2 Answers2

1

I just stumbled upon this. Apparently, if the text you enclose in backticks happens to be a class, it will be rendered as a hyperlink to the class.

edburns
  • 482
  • 1
  • 4
  • 13
  • I just tried this: `/** Example: "Bar()", another example: "doNothing()" */` - it only changed the font to a monospace one and didn't add a link. Edit: Stackoverflow changes the func names surrounded by backticks to code... To try it yourself, replace the four quotation marks with backticks. – Neph Jun 04 '19 at 11:44
1

This is done using double backticks (``) around your symbols name.

This is documented in detail here: https://developer.apple.com/documentation/xcode/formatting-your-documentation-content

Jon Cahill
  • 4,968
  • 4
  • 34
  • 31