0

I would like to create a framework with these constraints:

  • code is closed to integrator
  • the framework in itself is modularized. Example of modules:
    FeatureA      FeatureB      3rd party dependency (ex. a Swift Package or Cocoapod)
        ^             ^             ^
        |             |             |
        |_____________|_____________|
                      |
                    Core                    // client would integrate this
                      ^
                      |
                      UI                    // or this

in this example, I'd like to be able to build independently Core or UI.

  • Framework includes 3rd party dependencies and should be hidden from integrator
  • Framework contains many languages (Swift, Obj-c, Obj-c++ and c++)
  • Framework contains assets and localization
  • Included architectures: iOS device, simulator (both Intel and M1 arch versions)
  • Minimal SDK: 13.2

I have tried many approaches, but always hit a roadblock. For example, an XCFramework doesn't seem to be able to include successfully 3rd party. SPM doesn't seem to support exporting as binary. Aggregated framework: not sure how to include a cocoapod as dependent target.

Many of the posts I've read are quite old and refer to concepts I'm not sure still exists, like Fake Framework or Umbrella Framework.

So my question is this: what is the best approach, in today's environment, for these constraints? If XCFramework really is the best approach, how can we include 3rd party dependencies?

invalidArgument
  • 2,289
  • 4
  • 24
  • 35

1 Answers1

0

There is a very good solution available. XCFramework with Pods Dependencies

There is one issue though, third party dependancies. For third party dependencies, you have to add third party dependencies manually instead of pod. Also remember to remove their public header or just remove public keyword so that they are not accessible.

AsifHabib
  • 944
  • 9
  • 25