xcode 发布 Cocoapod 时包含图像资源
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28126788/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Including image assets when releasing a Cocoapod
提问by Daniel Farrell
I have made a custom Cocoa control and want to release it and write a podspec.
我制作了一个自定义的 Cocoa 控件,想发布它并编写一个 podspec。
My control contains one image. How can I package this image so that when others install my pod, my code can find the image?
我的控件包含一张图像。如何打包此映像,以便在其他人安装我的 pod 时,我的代码可以找到该映像?
At the moment the image is included in the example applications Images.xcassets file and loaded using [NSImage imageNamed:...]
. However, when others come to install my pod they won't want the example project: they will just want the classes and the image.
目前,该图像包含在示例应用程序 Images.xcassets 文件中并使用[NSImage imageNamed:...]
. 但是,当其他人来安装我的 pod 时,他们不需要示例项目:他们只需要类和图像。