17

Is it possible to set swift version compiler to version 3.0 for the pod named 'SideMenuController' in the Podfile below? If yes, then how to do it?

use_frameworks!
platform :ios, '10.0'

def shared_pods

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

end
Blazej SLEBODA
  • 8,936
  • 7
  • 53
  • 93
  • 1
    Possible duplicate of [How to set the Legacy Swift Version for each Pod in Podfile Xcode 9.0 Swift 3.2 / Swift 4.0](https://stackoverflow.com/questions/40501440/how-to-set-the-legacy-swift-version-for-each-pod-in-podfile-xcode-9-0-swift-3-2) – Cœur Jan 23 '19 at 10:27

3 Answers3

22
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
blyscuit
  • 616
  • 7
  • 12
8

Try This

# 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
Amul4608
  • 1,390
  • 14
  • 30
0
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
Jeremy Conkin
  • 1,194
  • 11
  • 9