Xcode 增强开发效率的插件

一般更新了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 @"33["
#define XCODE_COLORS_ESCAPE_IOS @"xC2xA0["

#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((@"

%s [Line %d] 
" fmt), __PRETTY_FUNCTION__, __LINE__, ## __VA_ARGS__)

#   define LogBlue(fmt, ...) (!isEnableXcodeColors() ? (DLog(fmt, ## __VA_ARGS__)) : (NSLog((XCODE_COLORS_ESCAPE @"fg0,0,255;" 
@"

%s [Line %d] 
" 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

3. Peckham

快捷导入.h文件,下载地址:https://github.com/markohlebar/Peckham

User guide
  • ⌘ + ctrl + P to invoke the popup
  • start typing or paste the keyword of your import
  • use  or  keys to navigate
  • press  or double click to add an import

 

4. KSImageNamed-Xcode

Image name autocompletion,download address:https://github.com/ksuther/KSImageNamed-Xcode

When calling: [NSImage imageNamed: or [UIImage imageNamed: , all the images in the project will conveniently appear in the autocompletion menu.

If you want to include the file extension when the autocompletion menu shows, you can execute following command in the terminal:

$ defaults write com.apple.dt.Xcode KSShowExtensionInImageCompletion -bool YES

5. BBUncrustifyPlugin-Xcode

Code formatting plugin,download address:https://github.com/benoitsan/BBUncrustifyPlugin-Xcode

The plugin will read a style configuration file (Uncrustify or Clang) to format your code. The configuration file must be located in the current directory or any parent directories of the source file. The search is started from the current directory.

 You can install the Uncrustify Plugin to help editing the Configuration file. Refer to link1 and link2 for more details.

Here is my Uncrustify configuration file.

版权声明:本文为博主原创文章,未经博主允许不得转载。

原文地址:https://www.cnblogs.com/yvette/p/4909710.html