发布于 2015-11-07 13:53:56 | 252 次阅读 | 评论: 0 | 来源: PHPERZ
CocoaPods Xcode依赖库管理
CocoaPods 是一个用来管理 Xcode 依赖库的项目。
sudo gem install cocoapods
pod setup
sudo gem update --system
gem sources --remove http://rubygems.org/
gem sources -a https://ruby.taobao.org/
gem sources -l
gem sources -l
如果出现下面
*** CURRENT SOURCES ***
https://ruby.taobao.org/
sudo gem install cocoapods
出现以下
Successfully installed cocoapods-0.39.0
Parsing documentation for cocoapods-0.39.0
1 gem installed
cd /Users/lanou3g/Desktop/未命名文件夹/text
jinzhao:text lanou3g$ touch Podfile
jinzhao:text lanou3g$ vim Podfile
//编写方式,如以下
pod 'SDWebImage', '~>3.7'
终端进入
vim Podfile(如果存在直接打开,不存在创建后打开)
此时进入文件,如果是编辑模式,即可以进行编辑,或者是命令模式
编辑模式—>ESC+shift+冒号键+w键,此时可以写入
编辑模式—>ESC+shift+冒号键+q键,此时已经离开
编辑模式—>ESC+shift+冒号键+wq键,此时写入并离开
编辑模式—>ESC+shift+冒号键+wq!键,强制写入并离开
命令模式—>i键—>进入编辑模式
set nu:显示行号
ESC后 输入dd 可以删掉一行
cd "you project home"//此为将文件放到根目录,小编本就在根目录下创建,故此步骤可省略
pod install//圆荚体安装
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Installing SDWebImage (3.7.3)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `text.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total
pod installed.
-> ComponentKit+SDWebImage (0.0.2) [DEPRECATED]
CKNetworkImageDownloading implementation for SDWebImage.
pod 'ComponentKit+SDWebImage', '~> 0.0.2'
- Homepage: https://github.com/eyeem/ComponentKit-SDWebImage
- Source: https://github.com/eyeem/ComponentKit-SDWebImage.git
- Versions: 0.0.2, 0.0.1 [master repo]
-> DSActivityIndicatorSDWebImage (1.0.6)
The easiest way to add a UIActivityView to your SDWebImage view.
pod 'DSActivityIndicatorSDWebImage', '~> 1.0.6'
- Homepage: https://github.com/diejmon/UIActivityIndicator-for-SDWebImage
- Source: https://github.com/diejmon/UIActivityIndicator-for-SDWebImage.git
- Versions: 1.0.6, 1.0 [master repo]
-> IMY_SDWebImage_Wrapper (1.0)
SDWebImageView 进度条支持
pod 'IMY_SDWebImage_Wrapper', '~> 1.0'
- Homepage: https://github.com/meiyoudev/IMY_SDWebImage_Wrapper
- Source: https://github.com/meiyoudev/IMY_SDWebImage_Wrapper.git
- Versions: 1.0 [master repo]
-> SDWebImage (3.7.3)
Asynchronous image downloader with cache support with an UIImageView
category.
pod 'SDWebImage', '~> 3.7.3'
- Homepage: https://github.com/rs/SDWebImage
- Source: https://github.com/rs/SDWebImage.git
- Versions: 3.7.3, 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.3)
- SDWebImage/MapKit (3.7.3)
- SDWebImage/WebP (3.7.3)
-> 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.1 [master repo]
-> SDWebImage-ProgressView (0.4.0)
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, 0.3.1, 0.3.0, 0.2.0, 0.1.0 [master repo]
-> SDWebImageFix (3.7.3.2)
Asynchronous image downloader with cache support with an UIImageView
category.
pod 'SDWebImageFix', '~> 3.7.3.2'
- Homepage: https://github.com/jumperb/SDWebImage
- Source: https://github.com/jumperb/SDWebImage.git
- Versions: 3.7.3.2, 3.7.3.1 [master repo]
- Subspecs:
- SDWebImageFix/Core (3.7.3.2)
- SDWebImageFix/MapKit (3.7.3.2)
- SDWebImageFix/WebP (3.7.3.2)
-> 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.5, 1.0.4, 1.0.3, 1.0.2, 1.0.0 [master repo]
-> UIActivityIndicator-for-SDWebImage+UIButton (1.2)
The easiest way to add a UIActivityView to your SDWebImage view.
pod 'UIActivityIndicator-for-SDWebImage+UIButton', '~> 1.2'
- Homepage: https://github.com/nobre84/UIActivityIndicator-for-SDWebImage
- Source: https://github.com/nobre84/UIActivityIndicator-for-SDWebImage.git
- Versions: 1.2 [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]
1.使用CocoPods生成的.xcworkspace文件来打开工程,而不是以前的.xcodeproj文件.
2.每次更改了Podfile文件,你需要重新执行一次pod update命令.