首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何为Podfile中的特定pod定义swift版本

如何为Podfile中的特定pod定义swift版本
EN

Stack Overflow用户
提问于 2018-07-31 21:26:18
回答 3查看 7.4K关注 0票数 15

是否可以将下面Podfile中名为'SideMenuController‘的pod的swift版本编译器设置为3.0版?如果是,那该怎么做呢?

代码语言:javascript
运行
复制
use_frameworks!
platform :ios, '10.0'

def shared_pods

    pod 'Alamofire', '4.6.0'
    pod 'SideMenuController', '0.2.4'

end
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2018-10-04 18:25:00

代码语言:javascript
运行
复制
post_install do |installer|
        installer.pods_project.build_configurations.each do |config|
            config.build_settings.delete('CODE_SIGNING_ALLOWED')
            config.build_settings.delete('CODE_SIGNING_REQUIRED')
        end
        installer.pods_project.targets.each do |target|
            if ['SideMenuController'].include? target.name
                target.build_configurations.each do |config|
                    config.build_settings['SWIFT_VERSION'] = '3.0'
                end
            end
        end
end
票数 19
EN

Stack Overflow用户

发布于 2018-08-01 12:34:41

尝尝这个

代码语言:javascript
运行
复制
# Uncomment the next line to define a global platform for your project
    # platform :ios, '9.0'

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

      # Pods for MyApp

      pod 'SideMenuController', '~> 0.2.4'
      pod 'Alamofire', '~> 4.6.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
票数 8
EN

Stack Overflow用户

发布于 2021-01-06 05:27:54

代码语言:javascript
运行
复制
post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == '<insert target name of your pod here>'
      target.build_configurations.each do |config|
          config.build_settings['SWIFT_VERSION'] = '<insert swift version here>'
      end
    end
  end
end
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51614520

复制
相关文章

相似问题

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