Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to define the swift version for a specific pod in a Podfile

Tags:

cocoapods

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
like image 740
Blazej SLEBODA Avatar asked Jul 31 '18 13:07

Blazej SLEBODA


People also ask

How do I specify Swift version in Podfile?

How do I configure each pod version in the Podfile installer? If I set config. build_settings['SWIFT_VERSION'] = '3.0' , than we have issues with Swift 2.3 pods. The best solution is if we set each pod legacy version separately to avoid having to manually set it.

How do I update a single pod?

When you run pod update SomePodName , CocoaPods will try to find an updated version of the pod SomePodName, without taking into account the version listed in Podfile. lock . It will update the pod to the latest version possible (as long as it matches the version restrictions in your Podfile).

Can a Swift package depend on a Cocoapod?

Unfortunately, swift-atomics doesn't support CocoaPods, so you'll need your own Podspec for it.


Video Answer


1 Answers

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
like image 79
blyscuit Avatar answered Sep 20 '22 10:09

blyscuit