iOS/Swift avoid duplicated symbols when embedding third-party library dependency into another library

136 views Asked by At

I'm interested in providing a library as an XCFramework to other developers, so that they can drag&drop it or use a Swift Package Manager to install and use that library.

Inside, however, that XCFramework uses multiple popular third-party dependencies. I'd like it to be self-contained, i.e. so that using my library won't require the developer to install or link other third-party libraries or impose any restrictions on what library versions they could use. Because of this, I'm including all of the dependencies into the resulting XCFramework.

Question

What is the best way to avoid conflicts in this scenario? Considering SwiftyBeaver and Apollo GraphQL iOS as the dependencies, what is the minimum that I have to rename?

  • Should I rename just the targets that I'll be importing?

  • Should I also rename the classes inside those libraries (as is the case with Objective-C)?

  • Will including third-party libraries cause any conflicts / linker errors in Swift at all (if the app developer imports my framework alongside with those 3rd party libraries)?

0

There are 0 answers