前言,還是那句話,按照濤叔下面畫黃色的步驟順序執行就好了

使用CocoaPods兩種方式:使用之前安裝的插件&命令行。

一、利用插件

1、創建項目后添加CocoaPods

2、在文本框中輸入如下插件名稱。

pod 'SDWebImage'

說明:添加多個插件,只需要換行添加 pod 'xxx'

//適配版本
platform :<#ios#>, "<#6.0#>" //插件名稱
pod "<#PodName#>" //單元測試
target :<#TargetName#>Tests, :exclusive => true do
# pod 'Kiwi'
end

3、安裝pods

在XCode下可以看到輸出:分析依賴,下載以來,安裝插件。。。。  等待安裝結束后回提示重啟打開,完畢!

(好吧,這裡沒有截圖,濤叔下載了最新版XCode  然後 插件沒有支持。之前版本的XCodey一直分析,就是沒有結果。再試試吧)

4、如果需要更新,就執行步驟3中的Update Pods

二、使用命令行操作

例如要使用"SDWebImage"

1、首先要找到項目路徑

$ cd  項目路徑

2、查找要用的插件

$  pod search sdwebimage

libotaodeMacBook-Pro:CocoaPod練習1 libotao$ pod search sdwebimage

-> ComponentKit+SDWebImage (0.0.)
CKNetworkImageDownloading implementation for SDWebImage.
pod 'ComponentKit+SDWebImage', '~> 0.0.1'
- Homepage: https://github.com/eyeem/ComponentKit-SDWebImage
- Source: https://github.com/eyeem/ComponentKit-SDWebImage.git
- Versions: 0.0. [master repo] -> DSActivityIndicatorSDWebImage (1.0)
The easiest way 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.)
Asynchronous image downloader with 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., 3.7., 3.7., 3.6, 3.5., 3.5., 3.5., 3.5, 3.4, 3.3,
3.2, 3.1, 3.0, 2.7., 2.7, 2.6, 2.5, 2.4 [master repo]
- Subspecs:
- SDWebImage/Core (3.7.)
- SDWebImage/MapKit (3.7.)
- SDWebImage/WebP (3.7.) -> SDWebImage+ExtensionSupport (3.7.1.2)
Asynchronous image downloader with cache support with an UIImageView
category. Added SD_APP_EXTENSION macro for ios8 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.4)
方便快捷的为UIImageView加上下载进度条,支持:下载失败显示裂图,显示 点击下载图片
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 [master repo] -> SDWebImage-ProgressView (0.4.)
Category on UIImageView, adding a progress view while images are downloaded
using SDWebImage.
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.3., 0.3., 0.2., 0.1. [master repo] -> UIActivityIndicator-for-SDWebImage (1.2)
The easiest way 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., 1.0., 1.0., 1.0., 1.0. [master repo] -> UIImageView+SDWebImage_M13ProgressSuite (0.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., 0.1. [master repo]

3、找到需要的插件創建Podfile文件(與使用touch Podfile 創建,open -e Podfile 修改相同

$ echo "pod 'SDWebImage'" > Podfile

4、安裝pod

$ pod install

等待,分析依賴,下載以來,安裝插件。。。。

libotaodeMacBook-Pro:CocoaPod練習1 libotao$ pod install
Analyzing dependencies
Downloading dependencies
Installing SDWebImage (3.7.)
Generating Pods project
Integrating client project

5、需要添加新的第三方庫

用記事本打開

open -e Podfile 

然後添加新的庫 (換行添加下面代碼即可) 

pod 'xxx' 

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

Pod 常用命令

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

命令: touch Podfile 创建

命令: open -e Podfile 打开

gem 常用命令

# 查看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使用CocoaPods的更多相关文章

  1. mac安装CocoaPods遇到的问题及解决办法

    (1)sudo gem install cocoapods Fetching: i18n-0.7.0.gem (100%) Successfully installed i18n-0.7.0 Fetc ...

  2. 最新Mac安装CocoaPods详细教程及各种坑解决办法

    网上有很多教程,但要么内容很老,要么不详细,要么各种坑的情况没写.最近买新电脑了,正好要走一遍这些流程,所以写下次教程. 一.安装RVM及更新Ruby 安装RVM的目的是为了更新Ruby,如果你的Ru ...

  3. mac安装cocoapods

    sudo gem install cocoapods

  4. mac上cocoapods安装与卸载

    安装 # 安装最新beta版 sudo gem install cocoapods --pre -n /usr/local/bin # 安装最新稳定版 sudo gem install cocoapo ...

  5. mac 安装cocoapods

    按主command+空格 输入ter 就能看到终端 左键单机(直接点回车键也可以)打开即可 需要先安装ruby环境 安装rvm curl -sSL https://get.rvm.io | bash ...

  6. 使用CocoaPods遇到的几个坑,记录一下

    最近使用pod的时候升级到1.0.0版本后遇到一些坑,整理一下 首先是CocoaPods报错:The dependency `` is not used in any concrete target ...

  7. 小菜鸟安装CocoaPods

    刚来到公司,以前没有用过CocoaPods. 参考的以下两篇文章,都是转载的. 第一篇比较偏技术性,叫做<Mac下CocoaPods安装步骤> http://blog.csdn.net/a ...

  8. CocoaPods 添加WebP失败解决办法

    pod 'sdwebimage/webp' 下载libwebp 超时 [!] Error installing libwebp [!] /usr/bin/git clone https://chrom ...

  9. CocoaPods的 安装 /卸载/升级

    CocoaPods用来管理第三方框架 Mac 安装 Cocoapods 导引如果你的 Mac OSX 升级到 10.11.x+, 并且需要安装 Cocoapods, 可以参考本博客.安装 rubyMa ...

随机推荐

  1. rabbitmq消息队列——"路由"

    在之前的教程中,我们创建了一个简单的日志系统.我们能够向许多交换器转发日志消息. 在本教程中,我们将添加一个功能--我们让它仅仅接收我们感兴趣的日志类别.举例:我们 实现仅将严重级别的错误日志写入磁盘 ...

  2. javascript_basic_04之节点、元素

    1.DOM:文档对象模型,Document Object Model: 2.BOM:浏览器对象模型,Browser Object Model: 3.DOM组成:核心DOM,XML DOM,HTML D ...

  3. 如何优雅的使用vue+vux开发app -03

    如何优雅的使用vue+vux开发app -03 还是一个错误的示范,但是离优雅差的不远了... <!DOCTYPE html> <html> <head> < ...

  4. MySQL5.7.13源码编译安装指南

    系统 CenterOs 6.5 1.安装依赖包(cmake make gcc等,其实好多都有了,不需要更新,为了防止世界被破坏,就装下) yum install gcc gcc-c++ -yyum i ...

  5. CCNA网络工程师学习进程(2)基本的网络设备

      在组网技术中用到的设备有中继器(Repeater).集线器(Hub).网桥(Bridge).交换机(Switch).路由器(Router).分别工作在OSI参考模型中的物理层.数据链路层和网络层. ...

  6. centos-lynx

    1.官网 http://lynx.isc.org 2.稳定版本 http://invisible-mirror.net/archives/lynx/tarballs/lynx2.8.8rel.2.ta ...

  7. CSS弹性盒模型flex在布局中的应用

    × 目录 [1]元素居中 [2]两端对齐 [3]底端对齐[4]输入框按钮[5]等分布局[6]自适应布局[7]悬挂布局[8]全屏布局 前面的话 前面已经详细介绍过flex弹性盒模型的基本语法和兼容写法, ...

  8. Microsoft Naive Bayes 算法——三国人物身份划分

    Microsoft朴素贝叶斯是SSAS中最简单的算法,通常用作理解数据基本分组的起点.这类处理的一般特征就是分类.这个算法之所以称为“朴素”,是因为所有属性的重要性是一样的,没有谁比谁更高.贝叶斯之名 ...

  9. Oracle闪回技术(Flashback)

    闪回技术有闪回表.闪回删除.闪回查询.闪回事务查询.闪回事务.闪回数据库.闪回数据归档.其中,闪回查询.闪回事务查询用来“观察”过去:闪回数据归档并不是一个独立的功能,其功能是扩展闪回查询的时间窗口: ...

  10. 面试准备 - 最大堆的Csharp实现

    面试中最常见的问题之一...在N个数中间寻找前K大个元素 最常见的解法就是最大堆 时间复杂度O(N*log(K)) 空间复杂度O(k) 实现了一个最简单的最大堆,每次有元素进来都和堆顶元素比较一下,如 ...