Context
We have a closed source binary that is distributed as an .xcframework
. We would like to leverage modules to help support a growing codebase and team.
Project Setup
Our project has many internal modules and we leverage the @_implementationOnly
attribute. Risks aside, this works great. We have types that need to be referenced by both the public API and an internal module.
Problem Statement
How can we setup the project to support using types in both the public API and the internal modules?
Details
It is understood that an .xcframework
can only have one module. In order for internal modules to reference the public facing types we need to either
- Have internal modules reference the public API module (Not possible given it creates a circular reference)
- Create a second
.xcframework
that contains the public types which both SDK and internal modules can reference (Requires special packaging to associate the.xcframework
dependencies. - Maintain a public API type and an internal type (Requires mapping layer)
Does anyone else have similar requirements? If so, how did you work around this constraint? Are there other options that are being overlooked?