"Good Programmer's note sharing"--cocoapods integration

Source: Internet
Author: User
Tags install cocoapods

-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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.