1

I'm using an xcframework to hide code.

So I've got an App.xcodeproj and the xcframework in one repo visible to contractors.

Then I have another private project which has everything in App.xcodeproj except has the framework project as a sub-project for easier development (instead of the compiled xcframework).

This works reasonably well except I have to keep the internal (private) and external projects in sync. Changes the contractors make to App.xcodeproj have to be manually brought over to the internal project, updating paths accordingly.

Is there a better way to do this?

Taylor
  • 4,661
  • 2
  • 24
  • 46

1 Answers1

0

I solved this by switching to separate Frameworks instead of a single xcframework, and using an xcworkspace.

It turns out Xcode will prioritize an implicit dependency over the compiled framework. So I only needed my app and framework projects in one (private) xcworkspace.

I'm using the fat framework approach to support the simulator, which is a bit uglier than using an xcframework. There was also a wrinkle in that I'm using Metal in the framework, so I had to load a separate Metallib when running in the simulator.

Perhaps at some point Xcode will have a target type for xcframeworks so it can track the implicit dependencies. See here for more on implicit dependencies.

Taylor
  • 4,661
  • 2
  • 24
  • 46