ak_tyagi
ak_tyagi

Reputation: 1602

How to manage common dependencies between project and frameworks in iOS

I have a framework (lets say XYZ) which uses a third party framework e.g Alamofire. The project in which i am importing my XYZ framework also uses the same third party framework. How can i manage this common dependency in my project to avoid duplication.

The XYZ framework has resources like storyboard.

Upvotes: 2

Views: 505

Answers (1)

Asperi
Asperi

Reputation: 257573

Here is a way...

  1. In target settings of main application add & embed both frameworks

demo1

  1. In target settings of XYZ framework add non-embedding dependency

demo2

  1. all linking will be done by Xcode and every framework will be included in main application bundle only once, so use import Alamofire in both target sources as usual

demo

Demo prepared & tested with Xcode 12 / iOS 14

Upvotes: 2

Related Questions