Mac uses Cocoapods

Source: Internet
Author: User
Tags install cocoapods

Preface, or that sentence, according to Wentao uncle under the yellow color of the step sequence to execute the line is good

Use Cocoapods two ways: Using the plug-in and command line of the previous installation.

First, the use of plug-ins

1. Add Cocoapods after creating items

2. Enter the following plug-in name in the text box.

' Sdwebimage '

Say: Add multiple plugins, just add the pod ' xxx ' to the line

// Fit Version " < #6 .0#> " // plug-in name " < #PodName #> " // Unit tests true  Do  ' Kiwi ' End   
View Code

3. Installation Pods

In Xcode you can see the output: Analysis depends, download, install plugins .... Wait for the end of the installation back to prompt to restart Open, finish!

(Well, there's no screenshots here, Uncle Wentao downloaded the latest version of Xcode and the plugin didn't support it.) The previous version of Xcodey has been analyzed, that is, no results. Try it again.)

4, if need to update, execute step 3 in the update Pods

Second, use the command line operation

For example, to use the "sdwebimage"

1, first to find the project path

$ cd Project Path

2. Find the plugin to use

$ pod Search Sdwebimage

libotaodemacbook-pro:cocoapod practicing 1 libotao$ pod search Sdwebimage-Componentkit+sdwebimage (0.0.1) cknetworkimagedownloading Implementation forSdwebimage. Pod'Componentkit+sdwebimage','~> 0.0.1'-Homepage:https://Github.com/eyeem/componentkit-sdwebimage-Source:https://Github.com/eyeem/componentkit-sdwebimage.git-Versions:0.0.1[master Repo]-Dsactivityindicatorsdwebimage (1.0The easiest-to-add a uiactivityview to your sdwebimage view. Pod'Dsactivityindicatorsdwebimage','~> 1.0'-Homepage:https://Github.com/diejmon/uiactivityindicator-for-sdwebimage-Source:https://Github.com/diejmon/uiactivityindicator-for-sdwebimage.git-Versions:1.0[master Repo]-Sdwebimage (3.7.2) asynchronous image downloader with the cache support with an Uiimageview category. Pod'Sdwebimage','~> 3.7.2'-Homepage:https://Github.com/rs/sdwebimage-Source:https://Github.com/rs/sdwebimage.git-Versions:3.7.2,3.7.1,3.7.0,3.6,3.5.4,3.5.2,3.5.1,3.5,3.4,3.3,   3.2,3.1,3.0,2.7.4,2.7,2.6,2.5,2.4[master Repo]-Subspecs:-Sdwebimage/core (3.7.2)     -Sdwebimage/mapkit (3.7.2)     -SDWEBIMAGE/WEBP (3.7.2)-Sdwebimage+extensionsupport (3.7.1.2) asynchronous image downloader with the cache support with an Uiimageview category. ADDED Sd_app_extension Macro foriOS8 Extensions pod'Sdwebimage+extensionsupport','~> 3.7.1.2'-Homepage:https://Github.com/rs/sdwebimage-Source:https://Github.com/glassoff/sdwebimage.git-Versions:3.7.1.2,3.7.1.1[master Repo]-Subspecs:-Sdwebimage+extensionsupport/core (3.7.1.2)     -Sdwebimage+extensionsupport/mapkit (3.7.1.2)-Sdwebimage-category (1.4convenient and quick for Uiimageview plus download progress bar, support: Download failure show crack, show click Download Picture pod'sdwebimage-category','~> 1.4'-Homepage:https://github.com/li6185377/sdwebimage-category-Source:https://Github.com/li6185377/sdwebimage-category.git-Versions:1.4,1.3,1.2,1.1.1,1.1[master Repo]-Sdwebimage-progressview (0.4.0) Category on Uiimageview, adding a progress view whileimages is downloadedusingSdwebimage. Pod'Sdwebimage-progressview','~> 0.4.0'-Homepage:https://Github.com/kevinrenskers/sdwebimage-progressview-Source:https://Github.com/kevinrenskers/sdwebimage-progressview.git-Versions:0.4.0,0.3.1,0.3.0,0.2.0,0.1.0[master Repo]uiactivityindicator- for-sdwebimage (1.2The easiest-to-add a uiactivityview to your sdwebimage view. Pod'Uiactivityindicator-for-sdwebimage','~> 1.2'-Homepage:https://Github.com/jjsaccolo/uiactivityindicator-for-sdwebimage-Source:https://Github.com/jjsaccolo/uiactivityindicator-for-sdwebimage.git-Versions:1.2,1.1,1.0.5,1.0.4,1.0.3,1.0.2,1.0.0[master Repo]-Uiimageview+sdwebimage_m13progresssuite (0.1.1) Category of Uiimageview, downloaded with sdwebimage, progressed with M13progresssuite. Pod'Uiimageview+sdwebimage_m13progresssuite','~> 0.1.1'-Homepage:https://Github.com/jowyer/uiimageview-sdwebimage_m13progresssuite-Source:https://Github.com/jowyer/uiimageview-sdwebimage_m13progresssuite.git-Versions:0.1.1,0.1.0[Master Repo]
View Code

3. Find the required plugin to create the Podfile file (with the same as using touch podfile to create,open-e podfile changes )

$ echo "pod ' Sdwebimage '" > Podfile

4. Install pod

$ pod Install

Wait, analysis depends, download, install plugin ....

libotaodemacbook-pro:cocoapod 1 libotao$ pod installanalyzing dependenciesdownloading dependenciesInstalling Sdwebimage (3.7. 2 ) generating Pods projectintegrating client project
View Code

5. Need to add new third-party repositories

Open it with a notebook

OPEN-E Podfile

Then add a new library (add the following code to the line)

Pod ' xxx '

=================================================================================

Pod Common Commands
# 搜索$ pod search AFNetworking# 安装$ pod install# 升级$ pod update

Command: touch podfile Create

Command: open-e podfile Open

Gem Common commands
# 查看gem源$ gem sources –l# gem自身升级$ sudo gem update –system# 查看版本$ gem --version# 清除过期的gem$ sudo gem cleanup# 安装包$ sudo gem install cocoapods# 删除包$ gem uninstall cocoapods# 更新包$ sudo gem update# 列出本地安装的包$ gem list
 

Mac uses Cocoapods

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.