Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Including image assets when releasing a Cocoapod

I have made a custom Cocoa control and want to release it and write a 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?

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.

like image 882
Daniel Farrell Avatar asked Jan 24 '15 14:01

Daniel Farrell


1 Answers

You can either include the files individually or with an xcassets file. Either way on the CocoaPods side you just need to include them in your spec as resources

like image 82
Keith Smiley Avatar answered Nov 15 '22 09:11

Keith Smiley