Can I add Nib files (.xib) to a static library?

I am developing a static library. To implement two main functions, I used only 4 xib. I added these files to the headers when creating the SDK. But when using the SDK in some other project as an implementation, I get an error, for example: "The application terminated due to the uncaught exception" NSInternalInconsistencyException ", reason:" Failed to load the NIB in the package "

Someone can give an answer quickly. Do I need to change the view controller? It will be very painful at this time.

thanks

+1
source share
2 answers

Since you are using a static library (which does not match the package), you cannot.

A static library is a single file containing the classes, code, and variables that were linked by the creator of the library. It does not contain other files in the form of XIB, it is, in fact, a database of compiled code.

+4
source

Yes, you can. add the xib file to your library, as for any regular project. Then, in the target library project, add the xib file to the Files folder along with the .a file. In your main project where you are using the library, drag the xib file where the .a file for the library is located.

+1
source

Source: https://habr.com/ru/post/949124/


All Articles