美文网首页
Swift学习笔记(二)集成Alamofire

Swift学习笔记(二)集成Alamofire

作者: Geniune | 来源:发表于2018-05-15 14:15 被阅读40次

Alamofire是纯Swift语言编写的HTTP网络开发工具包

方法一:手动集成

将目标工程clone到本地,当然也可以选择直接Download。GitHub URL:https://github.com/Alamofire/Alamofire

1.把Alamofire-master/Source文件夹复制一份,删除Info-tvOS.plist和Info.plist两个文件

2.Source文件夹拖入工程,注意勾上Copy items if needed选项

image.png

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,直接调用其方法即可

相关文章

网友评论

      本文标题:Swift学习笔记(二)集成Alamofire

      本文链接:https://www.haomeiwen.com/subject/rcgedftx.html