-ios Training, iOS learning------- -type technology blog, look forward to communicating with you! ------------Xcode Integrated pod Tutorial
Preparatory work:
First we'll install the pod in our computer, go to the command line, enter the following instructions
sudo gem install Cocoapods
Because is the installation operation, therefore needs sudo to obtain the administrator privilege, after the carriage return we will see the password word, enters our computer's password can
The computer will then automatically install the pod
See "Gems Installed" means the installation is complete. Here's how to integrate pod into our project
STEP1:
Let's start by creating a project called "Pod Test".
STEP2:
To enter the current project's folder on the command line
Briefly say the command line for several uses:
CD + space + file name = Enter folder
CD + Space +. = Return to previous level of directory
PWD View current directory
STEP3:
Enter the instructions for viewing help to see Help
Pod--help
STEP4:
Initialize pod
Pod Init
STEP5:
View all file directories under the current file
Ls-al
We'll find a file named Podfile in it, and we'll modify it with the VI compiler to add the frameworks and plugins we need.
Enter the following statement to edit the Podfile file
VI Podfile
Press "I", enter edit mode, move the cursor to the desired position, enter the following instruction
Pod ' afnetworking ', ' ~> 2.5 '
Press "ESC" + "shift" + ";" Exit edit mode
Input "Wq", enter, exit VI compiler
STEP6:
Enter the following statement to prepare for installation
Pod Install
The result is that this happens, according to the hint is because my current project Xcode is not closed due to the installation of the time is not open Xcode, so we first turn Xcode off
One more time
Pod Install
The installation is now successful.
Let's look at the folder directory of our project
Will find a workspace project, yes, that's the guy. Our original project is still in, if later to use the integration of the POD project will use workspace engineering.
We can then use the libraries we have installed.
"Good Programmer's note sharing"--cocoapods integration