Cocoapods installation and use in iOS

Source: Internet
Author: User

There are many articles on the internet about Cocoapods configuration articles, in fact, cocoapods configuration is not difficult, just more cumbersome, I also follow the site of the article step by step to build a successful configuration. The purpose of writing this article is like making notes, convenient for later use when good memories. Don't say much nonsense, start straight.

Cocoapods in iOS powerful features, I will no longer explain here (not clear friends, you can search)

One: Installation Prerequisites

1: Xcode must be installed

2: Command line must be installed in Xcode

Two: Start installing cocoapods (I assume everyone installs the first step)

1: download/install Cocoapods

①: Open Terminal input command

②: Enter the gem install cocoapods directly on the terminal

Three: Using Cocoapods

1: You first build a project in Xcode.

2: Open the terminal and use the CD command to navigate to the project root path that you want to use Cocoapods.

3: Now you need to build the Podfile file in the project (this is the CocoaPods fixed rule)

Step ①: Use the command to create Podfile

Touch podfile

Step ②: then edit the podfile file, command

OPEN-E Podfile

Step ③: Enter (what you want to download) in the edit screen that pops up

Platform:ios, ' 7.0 '

Pod ' reachability ', ' ~> 3.2 '

Pod ' sdwebimage ', ' ~> 3.7.3 '

Pod ' afnetworking ', ' ~> 2.5.4 '

...

Explain:

Platform:ios, ' 7.0 '---this must be added, it is best to specify the minimum version, the minimum support version 7.0.

Pod ' reachability ', ' ~> 3.2 ' means to download version reachability 3.2.

Pod ' sdwebimage ', ' ~> 3.7.3 ' means to download the Sdwebimage 3.7.3 version.

Pod ' afnetworking ', ' ~> 2.5.4 ' means to download the afnetworking 2.5.4 version.

Put the class library and version number that you need to add in order, one line at a class library.

4: How do I know to write pod ' reachability ', ' ~> 3.2 ', pod ' sdwebimage ', ' ~> 3.7.3 ', this doesn't need to be remembered. There is a very simple way.

①: Open the command terminal pod Search "The class library name you Need" (this class library name must be the correct existence)

Pod Search reachability

5: Last input pod install command to download successfully

http://blog.csdn.net/jymn_chen/article/details/19213601

Reference article http://my.oschina.net/vimfung/blog/182427

http://blog.csdn.net/wzzvictory/article/details/19178709

Reprinted from: http://www.cnblogs.com/gcb999/p/4741831.html

Cocoapods installation and use in iOS

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.