Cocoapods is a dependency management system that help us integrate third party libraries with ease. Its often very few projects that don't use third party libraries. These libraries are mostly open source or managed by companies for their products( For example, firebase SDK). 

Cocoapods reduce the effort integrating thirdparty libraries and removing the linking error we would face if we integrate manually.

Installing Cocoapods

  • Use the following command in terminal
    • sudo gem install cocoapods

​​Adding Cocoapods

After creating your first project, switch to the project folder in terminal using cd project_file_path

  • pod init
  • vi Podfile in terminal or open it manually in Xcode or basic text editor like Sublime Text.
  • Add your pods, For example add
    •  pod 'SpinKit', '~> 1.1'
    •  pod 'MBProgressHUD'
    • Finally save the file by typing escape and typing .wq (write and quit) in terminal or save in the basic text editor.​​​​​​​
  • Use pod install in terminal to install the pods
  • Now open the .xcworkspace file from the project folder and continue.