Xcode 注释工具的使用

 

1:Xcode 8之后

 

Goodbye World

In Xcode 8, Apple integrated a comment documentation generator plugin, which is built on top of VVDocumenter. Now this project is proud to be a part of Apple. It means you could just use the shortcut (⌥ Option + ⌘ Command + /) to add a documentation comment to your code if you are using Xcode 8 or above!

VVDocumenter is one of my hobby projects from 2013, back to the age of Xcode 4. It serves well for these years and I am so glad that it helps a lot of developers to improve their productivity. Since there is no need to install this plugin anymore, the development of VVDocumenter will not continue. Yes, it's time to say goodbye, with a happy ending.

Thank you all for your selfless support to this project. Let's build more great things and make the world better in future!

 

即,Xcode 8之后,无需使用注释插件VVDocumenter了,Xcode已经将其融合进去了

 

使用方法:option+command+/

 

 

 

2:Xcode 8之前

 

下载地址:https://github.com/onevcat/VVDocumenter-Xcode#goodbye-world

 

效果图

Objective-C效果图:
 
 
Swift效果图
 

 

安装步骤如下:
 
一、查看Xcode的UUID
 
方式1
终端执行 defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID
 

 

拷贝选中的字符串。
 
方式2
在应用程序目录中找到Xcode.app,右键”显示包内容”,进入Contents文件夹,双击Info.plist打开,找到DVTPlugInCompatibilityUUID,拷贝后面的字符串。
 
二、添加Xcode的UUID到VVDocumenter-Xcode的Info.plist文件
 
方式1--插件已经安装完成
1、打开xcode插件所在的目录:~/Library/Application Support/Developer/Shared/Xcode/Plug-ins;
2、选择已经安装的插件例如VVDocumenter-Xcode,右键”显示包内容”;
3、找到info.plist 文件,找到DVTPlugInCompatibilityUUIDs的项目,添加一个Item,Value的值为之前Xcode的UUID,保存。

 

 
方式2--插件还未安装/重新安装
1、从GitHub克隆仓库到本地,在Xcode中打开项目,选择项目名称,在TAGETS下选中VVDocumenter-Xcode;

 

2、选择Info,找到DVTPlugInCompatibilityUUIDs的项目,添加一个Item,Value的值为之前Xcode的UUID;

 

3、Build项目,VVDocumenter-Xcode会自动安装。
 
三、重启Xcode
Xcode 6之后,重启Xcode时会提示“Load bundle”、 “Skip Bundle”,这里必须选择“Load bundle”,不然插件无法使用。

 

posted @ 2016-12-26 14:43  Nelsen_Chen  阅读(502)  评论(0编辑  收藏  举报