如何在 Xcode 8.0 中安装 Alamofire 4.0
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39636385/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install the Alamofire 4.0 in Xcode 8.0
提问by Amutha Kumari
I am using the updated Xcode 8.0. How to install the alamofire 4.0 using cocoa pods. i am tried this one https://github.com/Alamofire/Alamofire. am getting an error when i convert the swift
我正在使用更新的 Xcode 8.0。如何使用可可豆荚安装 alamofire 4.0。我试过这个https://github.com/Alamofire/Alamofire。当我转换 swift 时出现错误
回答by iDeveloper
Just follow these easy step >>>>>
只需按照这些简单的步骤 >>>>>
1Open Terminal and Type gem install cocoapods
1打开终端并输入 gem install cocoapods
2Create Xcode project and set directory of project in terminal and and write pod init
2在终端中创建Xcode项目并设置项目目录并编写pod init
3A pod file will created, open it and write this -
3将创建一个 pod 文件,打开它并写入 -
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target '<Your Target Name>' do
pod 'Alamofire', '~> 4.0'
end
4Save init file cmd+S
4保存初始化文件cmd+S
5Finally write pod install
5最后写pod install
For complete reference please refer Alamofire
如需完整参考,请参阅Alamofire
回答by Alan Rabelo Martins
try this:
尝试这个:
pod 'Alamofire', :git => 'https://github.com/Homely/Alamofire.git', :branch => 'ios8'
回答by BharathRao
Follow the steps to install a pod:
按照以下步骤安装 Pod:
1) Open the terminal.
1) 打开终端。
2) Type pod
2) 类型 pod
3) You should be able to see usage and commands...
3)您应该能够看到用法和命令...
if (this is not the case ){
如果(事实并非如此){
Type: gem install cocoapods
类型: gem install cocoapods
Follow from Step 4:
从第 4 步开始:
} else {
} 别的 {
Follow from Step 4:
从第 4 步开始:
}
}
4) Navigate to the directory of the project in terminal.
4) 导航到终端中的项目目录。
5) Now type: pod init
5)现在输入: pod init
This will generate the pod file in your project directory with the respect to your project configuration...If you have enabled the tests,
UITests...then the pod file will look differently.
这将根据您的项目配置在您的项目目录中生成 pod 文件...如果您启用了测试,UITests...那么 pod 文件将有所不同。
6) You need to find these lines:
6)你需要找到这些行:
target 'your project name will come here by default' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for <your project name will come here by default>
//Add the below line:
pod 'Alamofire', '~> 4.0'<br>
7) Now Type: pod install
7)现在输入: pod install
That's it!!!(pod will get installed and you can use the methods you want...!)
就是这样!!!(pod 将被安装,你可以使用你想要的方法......!)