Cybotaur
Cybotaur

Reputation: 148

Add links to Swift classes in the quick help documentation comments?

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.

Upvotes: 12

Views: 3991

Answers (2)

Jon Cahill
Jon Cahill

Reputation: 4988

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

Upvotes: 1

edburns
edburns

Reputation: 532

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.

Upvotes: 1

Related Questions