3

I am creating a framework in Xcode for my iOS app which contains a large set of common classes which are used amongst several projects. Some of these classes have dependencies on other frameworks. However, there are also classes in other projects where I want to use this framework, which share some of the same framework dependencies.

To try simplify with an example:

  • Framework A: has classes which require Framework B
  • Project 1: includes Framework A, but has a class which requires Framework B.

I am currently including Framework B in Framework A so that my code will compile. There are two problems:

  1. Once I do this, I can't include Framework B in Project 1, because there is now a duplication of classes.
  2. It sounds like I'm creating an umbrella framework, which is usually discouraged.

Is there a way I can build Framework A in a way that says: "trust these frameworks will be included in any projects that use you, and don't include them yourself"?

Ricky
  • 3,101
  • 1
  • 25
  • 33
  • The simplest, but still by far the ideal solution, is to 'use CocoaPods'. See this SO questoin http://stackoverflow.com/questions/23056103/handling-dependencies-for-ios-framework-project. It'll do what you want, at the expense of having to buy into their ecosystem, and also add to compilation / build time whenever you update your dependencies (could be surprisingly often). I'm very interested in a solution that doesn't require CocoaPods. – fatuhoku Nov 25 '15 at 10:04

0 Answers0