How to go about adding a link/reference to another

2020-02-10 05:14发布

I am adding some description to my method in class. This is how I achieved this:

enter image description here

And it looks like this upon clicking...

enter image description here

How can I make the underlined method clickable? I want it to be referenced so that when a user clicks on it, they are directed to a particular web page for documentation.

Is it even possible? Thanks in advance, any help will be appreciated

3条回答
淡お忘
2楼-- · 2020-02-10 05:20

Use this

 /**
     *  <#Description#>
     *
     *  @link UILabel <#UILabel description#>
     *
     *  @return <#return value description#>
     */

Or you can try vvDocumenter for giving comments

查看更多
Lonely孤独者°
3楼-- · 2020-02-10 05:33

This link solved my problem

Particularly, this is how I went about it

enter image description here

Thanks to Oleg for the link

查看更多
甜甜的少女心
4楼-- · 2020-02-10 05:40

You can link to another method by tagging it with /// - Tag: and referring to it by Tag using the x-source-tag://[Tag] scheme like so:

/// - Tag: someMethod
func someMethod() {
   ...
}

/// Make sure to call [someMethod](x-source-tag://someMethod) at some point when overriding.
func otherMethod() {
   ...
}

Clicking on the someMethod link in the Quick Help pop-over will take you to the method and flash-highlight it in yellow.

查看更多
登录 后发表回答