How to link an App project to a Framework project so that changes made to the Framework code are "seen" in the App code without explicitly building the Framework code in Terminal?

I have learned how to create my own framework for "iOS" and "iOS Simulator" and then creating a single xcframework that I can drop into any project that needs to use my xcframework. So if I am working on an app, I can go to the app's project navigator > General tab > Frameworks, Libraries, and Embedded Content section, and drag my xcframework from Finder into that section. It works just fine.

But while working on the app, if I realize I need to make a change to the framework, I'd have to launch the project for the framework, make my changes, then in Terminal, run xcodebuild archive, run xcodebuild -create-xcframework, then go back to my app, run Cmd-B / Cmd-R to build/run it. And if there are still issues in the framework code, I'd have to keep executing these steps over and over again.

Is there a way to somehow link my app project to the framework project such that I simply make changes to the framework code and run Cmd-B in the app code immediately?

Replies

Please see TN2435 for how to accomplish this. Note that you don't need to use an XCFramework if you're not giving that framework to others as a pre-compiled binary, the advice in TN2435 will be all you need.

Add a Comment