如何在文档 Xcode 中添加对另一种方法的链接/引用?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38321880/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to go about adding a link/reference to another method in documentation Xcode?
提问by Akshansh Thakur
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
甚至有可能吗?提前致谢,任何帮助将不胜感激
采纳答案by Akshansh Thakur
回答by Clay Ellis
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:
通过Tag
使用如下x-source-tag://[Tag]
方案标记并引用它来链接到另一种方法:
/// - 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.
单击someMethod
快速帮助弹出窗口中的链接将带您到该方法并以黄色闪光突出显示它。
回答by Vibha Singh
Use this
用这个
/**
* <#Description#>
*
* @link UILabel <#UILabel description#>
*
* @return <#return value description#>
*/
Or you can try vvDocumenter for giving comments
或者您可以尝试 vvDocumenter 发表评论