working iOS: cocoa Pods: How do I add a new dependency to an existing pod?




update cocoapods (5)

I have juuuust started with Cocoa Pods.

I have this workspace now after initially experimenting and getting AFNetworking successfully connected via this Ray Wenderlich tutorial.

I want to now add in more dependencies like core-plot specifically. I found this link to a 'PodSpec' of Core-Plot

Problem is, I have no idea how to further implement this... Anyone have a quick run-down of what to mod and what commands in terminal to run?


Go to ur project folder and open terminal and set the project source to the terminal

-> Run open Podfile. Which opens the Podfile in textEdit.
-> Add pod'CorePlot', '~> 1.4' to it and save.
-> Run pod install -- NOTE(if u want to update all podfile then run pod update)

Simply run below command

pod update

After you have initially installed CocoaPods into your project, you can add new dependencies (or remove unused ones) by editing the Podfile. Then simply run pod install again.

If you use AppCode it has nice integrated support, so that it can update Pods for you, just edit the Podfile in AppCode, and it will suggest for you to add the new dependencies.

Edit:

In fact, run pod install again after adding new pods, not update.



You need to add the pod in Podfile and do pod install from terminal that's it. The steps can be summarized as

  1. In terminal change the directory to your project directory containing *.xcodeproj
  2. Run open Podfile. Which opens the Podfile in textEdit.
  3. Add pod'CorePlot', '~> 1.4' to it and save.
  4. Run pod install -- NOTE* that is **pod update if already installed.

You are good to go.





cocoapods