插件 KSImageNamed 用图片时自动显示图片缩略图

https://github.com/ksuther/KSImageNamed-Xcode

也是非常残暴的一个功能,在开发中我们的图片名称都是fb_poinum_high类似的,用这个插件敲出前缀就能够看到对应的一批图片缩略图再上下选择非常方便。 不足之处也有,那就是已经敲完的代码想看到图片缩略图必须先把imageNamed删掉 再重新敲一次才能看到缩略图,如果在@"fb_poinum_high" 图片名中一修改就能看到图片列表就更好了。

KSImageNamed 安装后无效解决方法

UIImage的imageNamed提供文件名自动补全功能。使用[UIImage imageNamed:@"xxx"]时,该插件会扫描整个workspace中的图片文件。
若安装后无效,或许需要做一下修改:

1.打开xcode插件所在的目录:
~/library/Users/“你自己的用户名”/Library/Developer/Xcode/Plug-ins
2.选择已经安装的插件KSImageNamed,右键点击show package contents(显示包内容),
3.找到info.plist 文件,找到DVTPlugInCompatibilityUUIDs的项目,
4.添加C4A681B0-4A26-480E-93EC-1218098B9AA0(当前xcode的一个号码
可在终端执行 defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID 即可获取相应号码)
5.再右键“显示包内容”双击contentsMacOS目录下的一个黑色图标,会打开终端窗口,最后打印“进程已完成”之类,
6.重启xcode

注意:xcode6版本适用上述方法,xcode7请看这一篇

Xcode 7安装KSImageNamed失败解决方法

 

## How do I use it?

Build the KSImageNamed target in the Xcode project and the plug-in will automatically be installed in `~/Library/Developer/Xcode/Plug-ins`. Relaunch Xcode and `imageNamed:` will magically start autocompleting your images.

**Important**: Old versions of KSImageNamed were installed in `~/Library/Developer/Application Support/Developer/Shared/Xcode/Plug-ins`. Make sure to remove `KSImageNamed.xcplugin` from there before installing the new one.

## How do I include file extensions when autocompleting?

Enter the following command and relaunch Xcode:
`defaults write com.apple.dt.Xcode KSShowExtensionInImageCompletion -bool YES`

以上是官方文档
下载最新版,在第一次安装的时候,跳出bundle选择的时候选择load,不然会安装失败

解决:

1.~/Library/Developer/Xcode/Plug-ins 删除KSImageNamed.

2.命令行敲入`defaults write com.apple.dt.Xcode KSShowExtensionInImageCompletion -bool YES

原文地址:https://www.cnblogs.com/ChouDanDan/p/5157429.html