# KSImageNamed-Xcode
---
## What is this?
Can't remember whether that image you just added to the project was called `button-separator-left` or `button-left-separator`? Now you don't have to, because this will autocomplete your `imageNamed:` calls like you'd expect. Just type in `[NSImage imageNamed:` or `[UIImage imageNamed:` and all the images in your project will conveniently appear in the autocomplete menu. You'll even get a handy preview of the image you're about to select.
![Screenshot](https://raw.github.com/ksuther/KSImageNamed-Xcode/master/screenshot.gif)
## How do I use it?
Build the KSImageNamed target in the Xcode project and the plug-in will automatically be installed in `~/Library/Application Support/Developer/Shared/Xcode/Plug-ins`. Relaunch Xcode and `imageNamed:` will magically start autocompleting your images.
## What does this work with?
Developed and tested against Xcode 5 and 5.1DP1. Xcode 4.6 is no longer supported.
## How do I include file extensions when autocompleting?
Enter the following command and relaunch Xcode:
`defaults write com.apple.dt.Xcode KSShowExtensionInImageCompletion -bool YES`
## Possible future improvements
Ideas for people who might want to hack on this:
1. Only include images that are in the current project. Currently all images in the workspace are shown.
2. Show an image preview and dimensions when clicking on an imageNamed: string in the editor
3. Switch to ARC since garbage collection support has been dropped
## License
MIT License
Copyright (c) 2013 Kent Sutherland
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
UIImage的imageNamed提供文件名自动补全功能。使用[UIImage imageNamed:@"xxx"]时,该插件会扫描整个workspace中的图片文件。若安装后无效,或许需要做一下修改:1.打开xcode插件所在的目录: ~/library/Application Support/Developer/Shared/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.再右键“打开报内容”双击contents\MacOS目录下的一个黑色图标,会打开终端窗口,最后打印“进程已完成”之类, 重启xcode
资源推荐
资源详情
资源评论
收起资源包目录
KSImageNamed-Xcode-master.zip (40个子文件)
KSImageNamed-Xcode-master
.DS_Store 6KB
KSImageNamed
DVTSourceTextView+KSImageNamed.m 2KB
KSImageNamed.m 12KB
IDEWorkspace+KSImageNamed.m 535B
IDEIndexCompletionStrategy+KSImageNamed.m 8KB
KSImageNamedIndexCompletionItem.m 4KB
DVTTextCompletionController+KSImageNamed.m 2KB
KSImageNamed-Info.plist 2KB
IDEIndexCompletionStrategy+KSImageNamed.h 201B
DVTTextCompletionListWindowController+KSImageNamed.m 2KB
en.lproj
InfoPlist.strings 45B
IDEIndex+KSImageNamed.h 165B
DVTTextCompletionListWindowController+KSImageNamed.h 220B
MethodSwizzle.h 1KB
Completions.plist 2KB
KSImageNamedPreviewWindow.h 343B
DVTSourceTextView+KSImageNamed.h 183B
KSImageNamedIndexCompletionItem.h 3KB
KSImageNamed.h 871B
XcodeMisc.h 4KB
IDEIndex+KSImageNamed.m 449B
DVTTextCompletionController+KSImageNamed.h 203B
KSImageNamedPreviewWindow.m 4KB
KSImageNamed-Prefix.pch 155B
MethodSwizzle.m 2KB
IDEWorkspace+KSImageNamed.h 173B
README.md 3KB
.gitignore 225B
KSImageNamed.xcodeproj
project.xcworkspace
contents.xcworkspacedata 157B
xcuserdata
admin.xcuserdatad
UserInterfaceState.xcuserstate 8KB
mac.xcuserdatad
UserInterfaceState.xcuserstate 7KB
zhxl.xcuserdatad
UserInterfaceState.xcuserstate 11KB
xcuserdata
admin.xcuserdatad
xcschemes
xcschememanagement.plist 484B
KSImageNamed.xcscheme 3KB
mac.xcuserdatad
xcschemes
xcschememanagement.plist 484B
KSImageNamed.xcscheme 3KB
zhxl.xcuserdatad
xcschemes
xcschememanagement.plist 484B
KSImageNamed.xcscheme 3KB
project.pbxproj 20KB
screenshot.gif 84KB
共 40 条
- 1
zw_yuyan
- 粉丝: 19
- 资源: 23
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页