ios - 为 Swift 2 更新 Alalmofire 和 SwiftyJSON

标签 ios xcode swift2 alamofire swifty-json

我是处理 pod 的新手,现在我正在尝试将 alamofire 更新到 alamofire 3.0,并将 SwiftyJSON 更新到 2.3.0 以获得 Swift 2.0 支持 进入项目目录后:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'Alamofire', '~> 3.0'
pod 'SwiftyJSON', '~> 2.3.0'

但是我得到了这些错误:

-bash: https://github.com/CocoaPods/Specs.git: No such file or directory
Mes-iMac:MyProject.xcodeproj Me$ platform :ios, '8.0'
-bash: platform: command not found
Mes-iMac:MyProject.xcodeproj Me$ use_frameworks!
-bash: use_frameworks!: command not found
Mes-iMac:MyProject.xcodeproj Me$ 
Mes-iMac:MyProject.xcodeproj Me$ pod 'Alamofire', '~> 3.0'
[!] Unknown command: `Alamofire,`

[!] Unknown command: `SwiftyJSON,`

有什么帮助吗?谢谢

最佳答案

您可以访问https://cocoapods.org/并找到您的图书馆。然后像这样复制链接:

enter image description here

在你的 Podfile 中使用 pod 'SwiftyJSON', '~> 2.3'pod 'Alamofire', '~> 3.1'

Podfile 将如下所示:

# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!

target 'YourProjectName' do
    pod 'SwiftyJSON', '~> 2.3'
    pod 'Alamofire', '~> 3.1'
end

然后再次运行pod install

关于ios - 为 Swift 2 更新 Alalmofire 和 SwiftyJSON,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34722367/

相关文章:

ios - Swift - 将控制台日志重定向到文档文件夹

iOS 发送带有位置对象的短信

ios - 居中堆栈 View 元素而不填充它们

ios - 带有 iOS 14 设备的 Xcode 10 - 尝试与此设备通信时遇到错误。 (该服务无效。)

iphone - 在 UITableView 中显示多种行类型

ios - Xcode、HMSoft HM-10 BLE不选择UUID直接连接一个模块

ios - UITabBarView 使图像变成圆形

ios - 无法更改 XIB 中的 View 大小?

ios - SpriteKit 支持不同的屏幕尺寸

iOS9 self.canDisplayBannerAds = true 不显示任何广告