Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build an iOS Framework with a dependency on another without creating an Umbrella Framework

Tags:

ios

frameworks

I am trying to streamline my development by creating some re-usable Frameworks which incorporate features I commonly re-use in multiple projects.

However, having setup one of my Frameworks I have encountered a problem, the classes have a dependency on the Firebase framework. Having read the Apple docs it's not recommended to create an Umbrella Framework (one which embeds another) especially if you do not have ownership of the embedded Framework (which I do not).

So the question is:

How can I create a Framework project which allows me to build the Framework without including the dependencies which would create an Umbrella Framework. I presume this is what people like Firebase do because when you add their Framework there are others you have to add to your project as well. I can't quite see how you would configure a project to allow you to build the Framework without errors but not include the dependencies.

For reference I am using the latest Xcode and need to support iOS 8 and above.

Thanks in advance for any thoughts / suggestions on this

like image 305
Gareth Clarke Avatar asked May 10 '16 18:05

Gareth Clarke


1 Answers

For the benefit of anyone who is struggling with the same issue, the answer is much simpler than I had anticipated.

The Frameworks are linked dynamically and simply adding a Framework to the project for your own framework will not cause it to be embedded in the output file and therefore not generate an Umbrella Framework. You don't actually need to do anything. Any Frameworks that are required by your own Framework can be included in your project so that you can compile your own Framework, and will also need to be included in any projects that utilise your Framework.

like image 83
Gareth Clarke Avatar answered Oct 06 '22 18:10

Gareth Clarke