首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Swift无法在Xcode8上通过cocoapods导入SwiftyJSON和Alamofire

Swift无法在Xcode8上通过cocoapods导入SwiftyJSON和Alamofire
EN

Stack Overflow用户
提问于 2016-09-20 09:31:00
回答 3查看 865关注 0票数 0

我需要在我的Swift项目中使用SwiftyJSON和Alamofire,所以我使用cocoapods。

我的podfile是:

代码语言:javascript
复制
platform :ios, '9.0'
target 'SwiftSalt' do
    use_frameworks!
    pod 'SwiftyJSON'
    pod 'Alamofire', '~> 4.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

此外,我还添加了一个USER_HEADER_SEARCH_PATHS,$(PODS_ROOT)/**。

但是,它仍然不起作用。它显示“没有这样的模块'SwiftyJSON'”。模块是什么意思?

EN

回答 3

Stack Overflow用户

发布于 2016-09-20 12:00:47

将config.build_settings更改为swift 2.3。因为swiftyJSON还在使用swift 2.3

代码语言:javascript
复制
 post_install do |installer|
installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
        config.build_settings['SWIFT_VERSION'] = '2.3'
    end
end

结束

票数 0
EN

Stack Overflow用户

发布于 2016-09-28 05:34:41

使用以下podfile安装了SwiftyJSON的Swift 3分支,并在项目中运行:

代码语言:javascript
复制
  platform :ios, ’10.0’

  project ‘/Users/You/yourproject.xcodeproj’

  target 'yourproject' do
  use_frameworks!
  pod 'SwiftyJSON', :git => 'https://github.com/appsailor/SwiftyJSON.git', :branch => 'swift3'
  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
票数 0
EN

Stack Overflow用户

发布于 2016-09-28 08:09:15

代码语言:javascript
复制
pod 'Alamofire', '~> 4.0'
pod 'SwiftyJSON', :git => 'https://github.com/appsailor/SwiftyJSON.git', :branch => 'swift3'
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39584390

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档