Importing local XCFramework to local swift package

Hello everyone! I'm starting modularization in my project, so inside my app's project I created one xcframework - AppNameServices and one swift package - AppNameUI. Can AppNameServices(xcframework) be used inside AppNameUI(swift package)? I saw that swift package provides .binaryTarget parameter where I can choose path to xcframework, but I'm not sure if it's a correct direction since my xcframework(AppNameServices) will constantly be updated so the only way is to specify path to derived data, which seems to be a fragile solution. What do you think? Is it a correct way to approach modularization in a project? Maybe I should use xcframeworks only?

Hey Maciej!

If you want to decompose your project into multiple modules, and as you said you're planning to constantly update them, then a better choice for you would be organizing your code with local packages.

XCFrameworks are usually used when you want to distribute your code in a binary form or precompile some of your internal or external dependencies to improve build times. It looks from your question that you don't need any of those. You can read more on possible use cases for the binary targets in the original proposal.

Hi Dima! Thank you for your response. I will then use local Swift packages. It seems that modularization using XCFrameworks has become an outdated approach. A couple of years ago, we weren't able to use resources in Swift packages, but a lot has changed since then. Given these changes, I will emphasize using Swift packages in my current and future projects.