iOS 之Cocoapods安装
2017-09-06 19:32
204 查看
该文章主要是用于辅助后期开发,达到快速安装效果,另一个目的是辅助需要的developer。
众所周知 Cocoapods 是一个管理三方类库的一个平台(框架),下面我主要介绍
安装步骤:
第一步:升级Ruby环境
sudo gem update --system
第二步:移除Ruby镜像
gem sources --remove https://rubygems.org/
第三步:添加新Ruby镜像
gem sources -a https://gems.ruby-china.org/
//Ruby镜像不支持
Error fetching https://gems.ruby-china.org/:
server did not return a valid file (https://gems.ruby-china.org/specs.4.8.gz)
第四步:重新更换Ruby镜像
gem sources --add http://rubygems.org/
第五步:确认添加镜像确认
Do you want to add this insecure source? [yn] y
http://rubygems.org/ added to sources
第六步:确认查看当前镜像
gem sources -l
*** CURRENT SOURCES ***
http://rubygems.org/
第七步:安装
cocoapods
sudo gem install cocoapods
框架导入项目步骤:
第一步:切入到项目目录
cd 项目路径
第二步:编辑一个Podfile文件
vim Podfile
i 进入编辑状态
编辑内容如下(下面是要导入的三方类库)
platform :ios,'8.0'
target 'freestyleAction' do
pod 'AFNetworking',
pod 'SDWebImage'
pod 'MBProgressHUD'
pod 'Masonry'
end
编辑完成后退出(在英文状态下编辑)
按
第三步:安装 pod
pod install
最后关闭所有Xcode,重新打开后就达到我们想要的效果。
众所周知 Cocoapods 是一个管理三方类库的一个平台(框架),下面我主要介绍
安装步骤:
第一步:升级Ruby环境
sudo gem update --system
第二步:移除Ruby镜像
gem sources --remove https://rubygems.org/
第三步:添加新Ruby镜像
gem sources -a https://gems.ruby-china.org/
//Ruby镜像不支持
Error fetching https://gems.ruby-china.org/:
server did not return a valid file (https://gems.ruby-china.org/specs.4.8.gz)
第四步:重新更换Ruby镜像
gem sources --add http://rubygems.org/
第五步:确认添加镜像确认
Do you want to add this insecure source? [yn] y
http://rubygems.org/ added to sources
第六步:确认查看当前镜像
gem sources -l
*** CURRENT SOURCES ***
http://rubygems.org/
第七步:安装
cocoapods
sudo gem install cocoapods
框架导入项目步骤:
第一步:切入到项目目录
cd 项目路径
第二步:编辑一个Podfile文件
vim Podfile
i 进入编辑状态
编辑内容如下(下面是要导入的三方类库)
platform :ios,'8.0'
target 'freestyleAction' do
pod 'AFNetworking',
pod 'SDWebImage'
pod 'MBProgressHUD'
pod 'Masonry'
end
编辑完成后退出(在英文状态下编辑)
按
esc,然后按
shift+zz(或者先按
shift+:,再按
wq)
第三步:安装 pod
pod install
最后关闭所有Xcode,重新打开后就达到我们想要的效果。
相关文章推荐
- [iOS]CocoaPods安装
- iOS之网络—— NSURLSessionDataTask文件离线断点下载、NSURLSession文件上传、AFN基本使用、Cocoapods安装
- iOS之Cocoapods安装
- iOS开发-Cocoapods安装
- iOS开发 非常全面的Swift资料收集
- iOS自动签名打包(xcodebuild)----常用
- IOS审核无法登陆问题解决方案
- iOS每日一记之———————————————模仿今日头条栏目选择效果 并且附加cell颤抖效果
- iOS开发 基于系统原生的语音识别助手
- iOS UITableView去掉多余表格线,tableView去掉表头空白、改变导航栏背景色和标题属性
- iOS沙盒目录结构解析
- iOS应用中使用Auto Layout实现自定义cell及拖动回弹
- iOS开发 - 多线程
- iOS block代码块强引用问题
- iOS-UIAlertView弹框2秒后自动消失
- iOS清除缓存
- iOS 实现后台运行
- ios项目(十四)
- IOS:将JSONMdel中的枚举类型转换为字符串(如果你想,当然也可以是任何你想要的数据类型)