Switching from CocoaPods to Carthage

History

CocoaPods has a longer period of time, which is maintained by the open source community. It is written in Ruby, and since Mac comes with Ruby, it can be run by default.

Carthage came out after iOS 8, written in Swift, and is maintained by GitHub engineers. As developers would install Xcode and its command line tools. It comes with swift compiler so that Carthage can be run in the command line.

Note: Apple is releasing Swift Package Manager in Swift 3.0, I am looking forward to see another dependency management system.

Centralized -> Decentralized

CocoaPods maintained the list of libraries in a GitHub repo. I remembered in the early days, the repo had about 500 libraries which was readable. Nowadays, the list is so long that even a modern browser would hand in displaying that repo.

Carthage however does not have a centralized repo. Developers would generally discover new libraries through trending. It fits into the nature of open source community more.

Workspace -> Project

In using CocoaPods, it builds a workspace. At the point you add CocoaPods, you will need to close the Xcode project and re-open the workspace in order to work properly. Hereafter, you will only access the workspace, which is manageable.

For Carthage, things stay in the same Xcode project, where developers can hold themselves in the same working environment.

Automatic -> Manual

After years, CocoaPods has evolved to a more stable system. It sets the necessary script, package and include the frameworks, does the code-signing properly. All you need to do as a consuming side, is to maintain that single Podfile. CocoaPods is now version 1.0.1

Carthage, however, aims to be flexible and unintrusive. Developers have to integrate the built frameworks manually. For the debug purpose, one shall include those dSYM files as well. It generally requires more knowledge about the development workflow. Carthage is now version 0.17.2


After all, why am I considering to switch to Carthage? It is mainly because of the app launch time. Based on some tests I performed earlier, seems like importing frameworks using Carthage have a shorter app launch time. That is important in terms of user experience. In order to improve this, it is valid to do more works as a developer.

In the meantime, I would hope there is an alternative written in Swift, decentralized, but integrate the frameworks for you automatically.

I would like to know more your thoughts, if you have experienced both CocoaPods and Carthage development flow. Please do write me a response sharing your opinions.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.