iOS-Framework
iOS-Framework copied to clipboard
Importing Headers Without Building
Hi, that's not a real issue with your frameworks style, but it is a problem during the workflow with them.
Say we have this scenario:
App --> Framework 1 --> Framework 2
--> Framework 2
It's a good practice to link everything into the app (you could see issue both with duplicate symbols and mysterious BAD_INSTRUCTIONs).
The problem is that app should build and link Framework1 and Framework2, but Framework1 should only import Framework2 headers.
I thought it should be ok if Framework1 only builds Framework2 without linking (to create .framework) but it's not the case: Xcode often makes confusion parallelizing builds, choosing the deepest build (with git submodules it could choose an old version...). What is more (the real problem) the #import <lib/header.h> could fail, because of crossing dependencies.
I circumvented this problem manually copying a reference of Framework2 headers in Framework1, adding a Copy Resources phase to Products Directory/AFolder/Framework2. So, I can set Header Search Path to this folder and #import <Framework2/Framework2.h> still works.
This workaround is ok, but everytime I add a public header to Framework2 I mess up Framework1.
Do you have a pretty idea to solve this problem? Maybe a cool script which automatically copies public headers of Framework2? :)