标题:
Swift学习笔记(二)集成Alamofire
[打印本页]
作者:
look_w
时间:
2019-3-7 19:24
标题:
Swift学习笔记(二)集成Alamofire
Alamofire是纯Swift语言编写的HTTP网络开发工具包
方法一:手动集成
将目标工程clone到本地,当然也可以选择直接Download。
1.把Alamofire-master/Source文件夹复制一份,删除Info-tvOS.plist和Info.plist两个文件
2.Source文件夹拖入工程,注意勾上Copy items if needed选项
3.重新编译工程
方法二:使用CocoaPods
source '[
https://github.com/CocoaPods/Specs.git
](
https://github.com/CocoaPods/Specs.git
)'
platform :ios, '10.0'
use_frameworks!
target '<Your Target Name>' do
pod 'Alamofire', '~> 4.7'
end
执行
pod install
注意:使用方法一手动集成后不用import Alamofire,直接调用其方法即可
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/)
Powered by Discuz! 7.0.0