Swift Package Manager vs CocoaPods vs Carthage

Handle those dependencies!

Steven Curtis
4 min readMar 19, 2023
Photo by Dan Gold on Unsplash

If you want to use third-party libraries in your App you are going to need a package manager.

We have often seen third-party developers take the lead with functionality, and later Apple add this functionality back into Xcode and Swift — with mixed results.

This pattern recurred with the advent of Swift Package Manager attempting to take the wind out of CocoaPods and Carthage's sails.

But which should you use if you are starting a project today?

Why use a package manager?

Imagine you want to use another programmers code. Before you add something into you code base you’d want it to be independent and well-tested. You’d see such packages on sites such as GitHub and think it a great way to speed your development time.

You start your new App and want to add network functionality with a third-party library. You’ve found a suitable library called Alamofire, and indeed many programmers use this for their projects so you feel secure about the quality.

Now there is an in-built problem here. If the third-party dependency has a bug in it and they fix it; do you want to use that new version with the fix (probably) and do you want to use…

--

--