I have a Demo project and Framework which can be integrated with multiple ways(Cocoapods, SPM - using generated XCFramework, directly integrate with XCFramework)
For distributing Demo app to external users we integrate the Framework with SPM.
Problem with this approch is during development its makes really hard to regenerate XCFramework after each change, so I have decided to drag and drop the Framework's project to Demo app, but cant understand how to recompile XCFramework if there is a change. Could you please help me with understading how to handle this scenario.
CodePudding user response:
Create an .xcworkspace
that contains the framework project and the demo app project side by side, then inside the demo app target General settings (see screenshot), add the .framework
file from the framework project within the workspace instead of depending on the .xcframework
binary file directly.
After that, add a "Copy File" build phase that embeds the framework file.