Reputation: 2059
Is it possible to create universal static libraries with resources(like images and xib files). I created static library with images and xib files in it and it is working good. But i need to create ".a" file. So that I can import .a file and use in multiple projects.
I generated ".a" file using lipo command but that doesn't worked. Please give any suggestion for generating .a file with xib files and images. Thanks in advance.,
Upvotes: 0
Views: 1700
Reputation: 8012
In order to package images and XIBs with a static library, you have to create a resource bundle.
Bundle
from OS X > Framework & Library
. Compile Sources
and Link Binary With Libraries
phases. Drag your images and XIBs to the Copy Bundle Resources
build phase. Base SDK
from Latest OS X
to Latest iOS
. Build
on the left. In the targets window, click the +
button and add your bundle target. This will then ensure your resource bundle is built every time your build your static library.You will need to change the code in your static library to load the XIBs and images from the resource bundle, rather than from the main bundle.
Add the resource bundle to the Copy Bundle Resources
build phase in your target application and link the app against the static library.
Upvotes: 2