Sweeper Sweeper - 2 months ago 6
iOS Question

What is the advantage of using CocoaPods?

A lot of the pods can be installed "manually" by simply dragging some files to the project. To me, this seems like a more convenient way to install a pod.

If I used CocoaPods, I would have to create a PodFile and execute a bunch of commands, add the framework to the "Linked Frameworks and Libraries" section, and rebuild. That seems like a lot of work. Yet CocoaPods is the "recommended" way to install pods.

I know that CocoaPods can detect updates for you. But it's not like you open Xcode and a message pops up that says one of your pods is outdated. You have manually use a command to check for updates. I mean, the reason you want to install a pod is because you want to use one of the features provided by the pod and you don't want to write it yourself. So an update with new features is probably not going to benefit me a lot.

And large-scale libraries like the AdMob SDK, even reminds you that an update is available when you run the app.

Are there other advantages of CocoaPods other than that it detects updates for you?

P.S. I corrupted my project a few times because of bugs in the new version of CocoaPods. This never happens with dragged-in files...


There are many pros of using Cocoapod over manually managing Dependencies in your project. I list few of them

  • A lib may refer another dependency which Cocoapod will take care itself. Manually you would have to download each one of them.
  • Lib has certain requirements like OS version, framework imports etc. Manual framework adding were a pain in Objective C.. swift doesn't have it. Cocoapod were a beast therefore back then.
  • Manually added dependency might not be easy to find for another coder. Pods ensure that one can go through the pods scheme or Podfile to understand what you have used.
  • Replacing a lib with new version is a pain manually when you have to delete prev files and add new - too many clicks. pod install will do it automatically using one command.

Also keeping aside the initial setup of pod in a project, all other steps of adding libraries is easier than the technical knowledge required to add a Lib manually.