Reputation: 87
I have a some question for my updated cocoapods.
My Xcode project is based on Swift 4.0 (Xcode 9).
And when I install cocoapods (use pod install
), installed frameworks automatically setup Swift 4.0 version. (Theses frameworks only support Swift 3.x)
Why does this happen? And how can I automatically set up, when pod install?
Upvotes: 1
Views: 1983
Reputation: 236
Add this into your pod file and set version of Swift (e.g 3.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'] = '3.0'
end
end
end
end
Upvotes: 5
Reputation: 25261
Pod is a version controlling tool and the version being the SDK version from the provider, not the software language version (eg, swift 3, 3.1 oe 4 etc)
It will download the specific version of SDK from the provider if you mentions the version. It will try to make the SDK works with your code but it there are software language versioning issues, it can't do much for you.
What you need to do in such situation is to fork the SDK on Github, then make changes to your forked version and check in. Then ask Pod to download your modified version.
Upvotes: 1