How to go about adding a link/reference to another method in documentation Xcode?

六月ゝ 毕业季﹏ 提交于 2019-12-18 04:06:08

问题


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

And it looks like this upon clicking...

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


回答1:


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.




回答2:


This link solved my problem

Particularly, this is how I went about it

Thanks to Oleg for the link




回答3:


Use this

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

Or you can try vvDocumenter for giving comments



来源:https://stackoverflow.com/questions/38321880/how-to-go-about-adding-a-link-reference-to-another-method-in-documentation-xcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!