Using CocoaPods in your Xcode project.
CocoaPods allows developers to easily integrate 3rd party libraries/frameworks into their projects without the need to manually download each library into your project and constantly check for updates individually.
For example, you have 10 libs or frameworks in your project, now imagine the time it will take you to check if anyone of them has any new version that you want to update? What if you need to revert to the old version? It does take time and is a nuisance, with CocoaPods you simply type pod update and updates the ones that have newer versions available.
Let’s get started.
Assuming you have a working Xcode project and you have CocoaPods installed via terminal.
Open a blank editor, I prefer Sublime Text. You can even use the default text editor that comes with Mac OS.
This file should be simply named Podfile and save this file to the same folder your project is located.
Should look something like this:
The target “MyApp” would be the name of your Xcode project.
The pod “Stripe” is just an example pod I used, you can take a look at all the pods available here.
You could specify the pod’s version like so:
pod ‘Stripe’, ‘10.0.1’
Now all you need to do is run pod install in terminal which will download all the libraries.
From now on, open and work with .xcworkspace instead of .xcodeproj.
Anytime you need to update the pod simply navigate to the project folder containing the Podfile and run pod update in terminal.