专业java、php、iOS、C++、网页设计、平面设计、网络营销、游戏开发、前端与移动开发培训机构
项目中使用到以下第三方框架
AFNetworkingSDWebImageSVProgressHUD
Pod 安装 第三方框架
- git 备份
- 打开终端
$ cd进入项目目录输入以下终端命令建立或编辑
Podfile// 创建 Podfile 文件 1.在终端输入 pod init 2.在Finder双击打开 Podfile设置
Podfile内容# Uncomment this line to define a global platform for your project platform :ios, ‘8.0’ target 'iOSWeibo12' do # Comment this line if you're not using Swift and don't want to use dynamic frameworks use_frameworks! pod 'AFNetworking' pod 'SDWebImage' pod 'SVProgressHUD' end- 保存退出
- 输入以下命令安装第三方框架
$ pod install - 注意:
- 不指定
use_frameworks会将所有第三方库打包成一个.a的静态库的 - 在
Swift项目中,cocoapod仅支持以Framework方式添加框架,因此需要在Podfile中添加use_frameworks! - 如果网速慢只想用本地的库使用
pod install --no-reop-update pod install一个项目只需要一次,以后更改了只需要pod update
- 不指定
- 提交代码
- 以后打开工程使用
项目名称.xcworkspace - 运行:看看添加框架是否有问题