代码之家  ›  专栏  ›  技术社区  ›  Blazej SLEBODA

如何定义pod文件中特定pod的swift版本

  •  9
  • Blazej SLEBODA  · 技术社区  · 6 年前

    是否可以在下面的pod文件中将名为“sideMenuController”的pod的swift版本编译器设置为3.0版?如果是,那怎么做?

    use_frameworks!
    platform :ios, '10.0'
    
    def shared_pods
    
        pod 'Alamofire', '4.6.0'
        pod 'SideMenuController', '0.2.4'
    
    end
    
    2 回复  |  直到 6 年前
        1
  •  11
  •   blyscuit    6 年前
    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
    
        2
  •  7
  •   Amul4608    6 年前

    # 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