Xcode 增强开发效率的插件

来源:互联网 发布:ubuntu的vim怎么装不了 编辑:程序博客网 时间:2024/06/02 03:01

一般更新了Xcode之后,插件不可用,需要重新下载以下插件(作者会及时更新插件以支持新的Xcode版本)重新编译安装。

1. XcodeColors  

为Log标记不同颜色,便于区分日志类型及Debug

下载地址:https://github.com/robbiehanson/XcodeColors

首先安装插件

 *  是否启用了XcodeColors,以自定义颜色显示output log. *  启用的条件是:1)xcode安装XcodeColors插件,2)设置环境变量XcodeColors=YES * *  @return YES:开启使用XcodeColors */BOOL isEnableXcodeColors() {    char *xcode_colors = getenv("XcodeColors");    if (xcode_colors && (strcmp(xcode_colors, "YES") == 0)) {        return YES;    }    return NO;}</a>

然后定义宏(例如以蓝色字体输出Log)

//use dlog to print while in debug model#ifdef DEBUG#define XCODE_COLORS_ESCAPE_MAC @"\033["#define XCODE_COLORS_ESCAPE_IOS @"\xC2\xA0["#if 0#define XCODE_COLORS_ESCAPE  XCODE_COLORS_ESCAPE_IOS#else#define XCODE_COLORS_ESCAPE  XCODE_COLORS_ESCAPE_MAC#endif#define XCODE_COLORS_RESET_FG  XCODE_COLORS_ESCAPE @"fg;" // Clear any foreground color#define XCODE_COLORS_RESET_BG  XCODE_COLORS_ESCAPE @"bg;" // Clear any background color#define XCODE_COLORS_RESET     XCODE_COLORS_ESCAPE @";"   // Clear any foreground or background color#   define DLog(fmt, ...) NSLog((@"\n\n%s [Line %d] \n" fmt), __PRETTY_FUNCTION__, __LINE__, ## __VA_ARGS__)#   define LogBlue(fmt, ...) (!isEnableXcodeColors() ? (DLog(fmt, ## __VA_ARGS__)) : (NSLog((XCODE_COLORS_ESCAPE @"fg0,0,255;" \@"\n\n%s [Line %d] \n" fmt XCODE_COLORS_RESET), __PRETTY_FUNCTION__, __LINE__, ## __VA_ARGS__)))

2. VVDocumenter-Xcode

快捷添加注释,下载地址:https://github.com/onevcat/VVDocumenter-Xcode

例如,在需要添加注释的地方连续输入三个“/”个字符即输入“///” 即生成注释模板

/** *  <#Description#> * *  @param view <#view description#> * *  @return <#return value description#> */- (BOOL)egoRefreshTableHeaderDataSourceIsLoading:(EGORefreshTableHeaderView *)view



0 0
原创粉丝点击