ios - Alamofire 不会在 podfile 中使用 osx 而不是 ios

标签 ios xcode swift macos alamofire

我正在尝试为我的 macbook pro 构建一个菜单栏应用程序,并且需要发出 GET 请求以从 API 获取数据。但是,当我尝试导入 Alamofire 时,我得到了 没有这样的模块“Alamofire”

这是我的播客文件,

source 'https://github.com/CocoaPods/Specs.git'
platform :osx, '10.9'
use_frameworks!

target 'WakaMenu' do

pod 'Alamofire', '~> 3.3'
pod 'AlamofireObjectMapper', '~> 3.0'

end

target 'WakaMenuTests' do

end

我正在运行 Xcode 7.3,我的项目基础 SDK 和部署目标是 10.11

当我尝试仅使用平台 ios 9.0 时,它仍然显示错误。

最佳答案

试试这个...

source 'https://github.com/CocoaPods/Specs.git'

platform :osx, '10.12'
use_frameworks!

target 'targetname' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks

  pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :tag => ‘4.3.0’
end


post_install do |installer|
   installer.pods_project.targets.each do |target|
       target.build_configurations.each do |config|
           config.build_settings['SWIFT_VERSION'] = '3.0'
       end
   end
end

关于ios - Alamofire 不会在 podfile 中使用 osx 而不是 ios,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36868858/

相关文章:

ios - 我如何在 iOS 7 中使用 Mandrill 向我的 Parse 支持的应用程序管理员发送一封简单的电子邮件?

objective-c - 如何在 block 中使用自定义类型的参数

iOS SDK-如何检测饼图切片上的触摸?

ios - X代码/swift 3 : How to shift storyboard elements down/up without messing up existing constraints?

ios - "No such module"每次打开项目时第 3 方框架导入问题

swift - Swift 中的段错误

ios - 在 Swift 中按回车键在文本字段之间切换

ios - 如何将带有手势识别器的 UIView 作为参数传递?

ios - 如何获得 Xcode 项目文件的较短路径

ios - CC2650 模块无法通过蓝牙与 iOS 应用程序连接