I was wanting to write this post from the very first day i started this blog and today i am finally writing this blog. Most of you might be using this and will find this blog as boring, feel free to navigate to other blog post as this will be the very basic level of POD installation instruction and walk through.
Why PODS ?
PODS are great way to manage Third Party extensions and update them easily. PODS will create a different workspace where in your project and third party codes will reside in different projects and with a single command your all third party library will be updated to their latest version. So i recommend use of PODS. And very important reason that we should learn PODS is we stuck up at simply running the project that uses PODS 😛 This will help us to successfully run the project which uses PODS.
Lets start with the basic steps to integrate the PODS
You need to install the cocoapods in your system. Ghrrrr how to do that ? Simply copy and paste following command on your terminal.
sudo gem install cocoapods
You need to navigate into your project directory and run following command.
cd '<Project Folder>' pod init
This will init the POD into your project directory
Now you need to run the code to actually install the POD into your project
Now you will see workspace is added in your project. Close all project and open the work space. In workspace you will find POD file. Check the below sample POD file.
platform :ios, '8.0' target 'MyApp' do pod 'AFNetworking', '~> 2.5' pod 'ORStackView', '~> 2.0' pod 'SwiftyJSON', '~> 2.1’ end
Here we have added 3 pods including afnetworking.
Now you need to actually run following code to install that third party code into your project as below :
And you are done. Hope this helps.