Adding Swift Package Manager Support to a Legacy Objective-C Project
I recently needed to add Swift Package Manager support to a legacy package that one of my projects was using. The package was originally distributed with CocoaPods. The primary reason for migrating from CocoaPods to SPM is that CocoaPods entered maintenance mode a few months ago. Removing it will future-proof our projects and allow us to use the latest features, such as the buildable folders introduced in Xcode 16. Assumptions Since this was an internal package, I did not need to maintain CocoaPods support. The goal was to replace it entirely with SPM. It is certainly possible to keep both, but that would require some additional work. The project I was working on is considered legacy; no one has touched it in about six years. Once this task is complete, I hope no one will need to update it for another half-dozen years. This allowed me to take some shortcuts, like integrating a third-party dependency directly into the codebase instead of spending time updating it to the latest version. All internal dependencies of your framework already support SPM. With that said, let’s get started. ...