Reputation: 1253
I have a app with swift version 2.3.
When I try to run in xcode 8 with set "User Legacy Swift -> YES" in build setting, it give me errors for cocoapods only.
see below image:
MY pod file:
platform :ios, '8.0'
use_frameworks!
target 'xxx' do
pod 'Alamofire', '~> 3.3'
pod 'PKHUD', '~> 3.1'
pod 'SCLAlertView', '~> 0.5'
pod 'SwiftyJSON', '~> 2.3'
pod 'ICSPullToRefresh', '~> 0.4'
pod 'ReachabilitySwift', '~> 2.3'
pod 'IQKeyboardManagerSwift', '~> 4.0'
end
target 'xxTests' do
end
target 'xxUITests' do
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '2.3'
end
end
end
Upvotes: 3
Views: 5020
Reputation: 2695
This is the only thing that worked for me...
Note that this error is currently in a pod, but could be anywhere in your project tree. I’m going to show you how to “allow” Swift 2.3 in this pod. Basically we need to enable “Legacy Swift Language”. Select your pod framework (by clicking on it in the error navigator) and under Build Settings find “Use Legacy Swift Language Version”
Set it to “Yes”. Than “Build & Run” again to test it.
Check out this post: http://rebeloper.com/downgrade-swift-3-swift-2-3-xcode-8/
Upvotes: 2
Reputation: 5762
This basically means that the pods are built for different swift version than your current project.
In my case my app migrated to Swift 3 but my pods remained on Swift 2.3 because they haven't adapted to Swift 3 yet. You can do either of the two things here:
I hope this sheds some light on the issue.
Upvotes: 2