Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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...

like image 270
Sweeper Avatar asked Aug 06 '16 13:08

Sweeper


Video Answer


2 Answers

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.

like image 109
Shubhank Avatar answered Sep 20 '22 18:09

Shubhank


CocoaPods are come up with one command which links to set all your dependencies, one pod file, list all libraries you want to use and just run pod install everything cocoaPods does for you.

No more headache to set the same framework manually as well if updates were there then also cocoa pods managed by them self.

Project sharing/uploading will be easy as all framework are included virtually with one command where previously after adding framework we need to share the whole project with adding up all framework which is added in the App and if some files are not linked or not shared properly - other developers do waste their great amount of time to resolve these error.

Library search path, header path, and framework everything is handled by CocoaPods where previously a developer needs to take care for such things which are consuming and difficult to manage.

Also Just review one file which library used in project instead of check whole framework and search all of them at different places of GitHub.

CocoaPods make developer life easy to install dependencies and make coding with an easy way.

I hope this information helps you :)

Happy Coding!

like image 41
Anita Avatar answered Sep 19 '22 18:09

Anita