What is the advantage of using CocoaPods?

后端 未结 3 1133
说谎
说谎 2020-12-31 03:03

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 use

相关标签:
3条回答
  • 2020-12-31 03:40

    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.

    0 讨论(0)
  • 2020-12-31 03:46

    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!

    0 讨论(0)
  • 2020-12-31 03:46

    In additions to Shubhank's and Anita's answer I am adding some more points from my own experience:

    • Light Repo: Since it's recommend that you only commit your code and leave pod to be fetched using pod install each time a new user pulls your code. Cocoa pos make your code folder light. If you ever need to make a change in any pod, it's always recommend to make a PR request and and update that so other user can be benefited from your amazing work.
    • Dependency: Considering the content of your question I believe you are new to objective-c, swift, development. You'll love cocoapod if had to actually check the build setting of project and try to set the required header search path and framework search path and not only that you will also need to set flags, lots of those, linker flag, librarian flag if you are trying to use some fat library like XMPP or OpenCV.
    • Centralization: If you need to integrate a feature, which you think is common and many people must have face similar issue. What you do is, got to cocoapod.org and search for the feature. Most of the time you will get a fine library doing similar work which you can integrate and use.
    • Documentation: Cocoapods provide fine detail and that is required to have it integrated also sometimes why is that needed.
    • Removing: Today itself I deleted pubnub and integrated XMPP in my code, which would have been way more tedious and time consuming if I had to do it manually, with taking care of all those search path and flags.
    • Time: With all above you will save exponentially in your library integration time, which you can use to integrate more beautiful pods which makes your product look beautiful.

    For even more details I would like you to see the faq link from the website: https://guides.cocoapods.org/using/faq.html.

    0 讨论(0)
提交回复
热议问题