12

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

Gareth Clarke
  • 291
  • 2
  • 8
  • How did you achieve it? I want to create a framework which has dependency to other frameworks or SDKs say Facebook sdk. How should I do it so that I need to give only 1 framework to my users? – anoop4real Jul 19 '17 at 05:30

1 Answers1

9

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.

Gareth Clarke
  • 291
  • 2
  • 8
  • Did this change at some point because that is not the behaviour I am seeing with my framework, it simply bundles everything into the output file which is exactly the opposite of what im trying to achieve?? – AngryDuck Aug 15 '19 at 14:26
  • I am struggling with this issue now. I am using a dependent framework, which has dependency to fire base and my project also needs this firebase. The dependencies are managed by cocoa pods. So the events are not triggering in expected way. So does cocoa pods create umbrella frameworks ? – Govind Feb 19 '20 at 05:50
  • Coming in 7 years late, did you get answer to Why we need to add 3rd party dependencies like Firebase to client apps explicitly? If those dependencies are static, shouldn't they be automatically linked to your framework's binary and you don't have to ship them explicitly? – ImShrey Jun 29 '23 at 19:07