0

I am building a new UI framework, let's call it a framework2, there is already existing UI framework framework1, unfortunately can not add or make more changes to that framework1(Provide by a vendor, and we can't have source code access of it.), but now we want to build framework2 on top of framework1, in framework 2 we will be using few of the components developed in framework1 and extend them.

So can we add framework 1 into framework 2?, and then distribute framework 2 as XCFramework via swift package?

I read that iOS doesn't support the umbrella framework concept, is this the case here

Checked different stack overflow links, and blogs, but couldn't find anything concrete.

so that means I should add framework1 as a binary dependency in framework2 using SPM. PFA screenshot Framework 2 dependecny

Vishwa
  • 11
  • 2
  • Not tried it, but technically I can't think why not. You might need to check the third-party licensing though. Why not knock up a simple test project and try it? – flanker Aug 02 '23 at 23:10
  • 1
    @flanker Thanks for the reply, I wanted to confirm this as https://forums.swift.org/t/xcframework-with-hidden-dependency/50840 it says nested frameworks not allowed in iOS. – Vishwa Aug 02 '23 at 23:33
  • No but a package can contain frameworks – lorem ipsum Aug 03 '23 at 01:14
  • @loremipsum Could you please check the attached screenshot, are you suggesting that I should add framework1 as a binary dependency in framework2 using SPM? – Vishwa Aug 03 '23 at 01:53
  • No you can add Framework1 to your own SPM, not Framework2. Framework2 is replaced by a Package. – lorem ipsum Aug 03 '23 at 02:05
  • yes, framework1 will be on it's own Package, but as framework2 depends on it, will have to add framework 1 in framework 2 as a dependency as it's in screenshot. Let me know if I have wrong understanding here. – Vishwa Aug 03 '23 at 02:08
  • Framework2 can’t include Framework1 it isn’t allowed. But a package can include a framework. – lorem ipsum Aug 03 '23 at 02:10
  • https://developer.apple.com/documentation/xcode/creating-a-standalone-swift-package-with-xcode – lorem ipsum Aug 03 '23 at 02:11
  • https://developer.apple.com/documentation/xcode/distributing-binary-frameworks-as-swift-packages – lorem ipsum Aug 03 '23 at 02:12
  • Thanks mate, one more query then how to distribute Framework2 (Which is swift package, adds the dependency Framework 1), I want to distribute Framework2 as XCFramework and will be distributed through SPM. – Vishwa Aug 03 '23 at 02:53
  • It isn’t possible to publish as a framework you have to publish as a package. Dependencies are not allowed in frameworks. You would publish on git just like the Lottie package you are using. – lorem ipsum Aug 03 '23 at 08:56
  • okay, so basically framrwork2 package will be distributed as a source code through GIT. – Vishwa Aug 03 '23 at 09:12

0 Answers0