Cafe App iOS: Implementing Swift Package Manager for Modularization and Resolving Cocoapods Dependency Management Issues
Key point
The Cafe App iOS team shared their experience of adopting Swift Package Manager to resolve Cocoapods' manual dependency management issues and achieving modularization by separating targets in a mixed Objective-C/Swift project.
Details
The Cafe App Development Team adopted Apple's official dependency management tool, Swift Package Manager (SwiftPM), to improve build speeds and achieve modularization as the project scale expanded. They resolved the hassle of manually adding dependencies to the Podfile when internal framework dependencies changed under the previous Cocoapods setup by leveraging SwiftPM's automatic dependency management features. During the adoption process, they addressed the single-target limitation of SwiftPM in projects with mixed Objective-C and Swift files by separating targets by language and configuring publicHeadersPath. Additionally, to prevent duplicate library linking issues that can occur when running Cocoapods and SwiftPM in parallel, they migrated most libraries to SwiftPM. They have now completed the transition, excluding some Enterprise libraries, and aim to remove Cocoapods in the future.