Cocoapods — install tutorial
Cocoapods is a strong and convenient third-party library manage tool for swift and object-c developing environment, in this topic, if you want to learn more about cocoapods, you can see the following website: https://cocoapods.org.
In this topic, I will teach you how to install Cocoapods step by step, if you have any problem, you can message me and we can discuss together.
My address: firstname.lastname@example.org
Step 1: Start you terminal and Install ruby 2.2.2
Insert following commands line by line
curl -L https://get.rvm.io | bash -s stable
rvm install 2.2.2
After command install 2.2.2, you will see following info that the system is asking you for your user password, insert your OS password and continue
password required for 'mkdir -p /etc/openssl':
Step 2: Install cocoapods and find the package you want
cocoapods install command:
sudo gem install cocoapods
After succesfully installed cocoapods, goto cocoapods website to get the “name”(all you need is the name of the package) of the package you want >>> https://cocoapods.org.
Step 3: Insert pods to your project
In this step, I will use “SDWWebImage” for example, first find the route of your project and redirect your terminal command the folder of your project file, my route for example: “Documents/PeterPanClass/class13thPrac”
Now you will in the pod editing window, following below steps to install pods.
- press button “i” to become insert mode.
- paste pod name to the Podfile.
- press button “esc” to leave insert mode.
- press shift+: to insert command.
- insert wq(w means save change, q means quit) to save and quit.
Now you can install to pod to your project by the command below
Step 4: Chech if the pod succesfully installed to your project
Now when you want edit your project, open the xcworkspace rather than xcodeproj, you new xcworkspace will looks like this.
And you will find pod documents in your workspace.
If you have any problem or question about this tutorial, email me or send iMessage to my apple id: email@example.com (The iOS developer must using iPhone right?)