I am using the Xcode 8.0 GM. I created a default single-view app with my deployment target set to 9.0.
In my Podfile I\'m targeting the bleeding edge Swift 3 branch:
The solution is to change your request from this
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'swift3'
to this
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'master'
I solved similar issue by using :
platform :ios, '9.0'
use_frameworks!
target 'PROJECT NAME HERE' do
pod 'Alamofire'
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
You should use the master
branch now since the swift3
branch has been merged there. Moreover it's normal for the Xcode Migrator to show that many errors. What it's doing s compiling the code thinking it's a legacy Swift version but since it's already in Swift 3.0, the errors are to be expected. Finally, Xcode is asking you to convert to modern Swift syntax probably because you haven't used the latest version of Cocoapods to install Alamofire.
NB: event though Cocoapods tells you to use gem install cocoapods --pre
, I prefer using gem update cocoapods --pre
. Else, the older version of Cocoapods stays and still is used when using pod update
. Check what version you're using with pod --version
.
I had the same issue, but I uninstalled cocoapods, uninstalled alamofire, then updated my cocoa pods to 1.1.0.beta.2, then used the swift3-rebased branch of Alamofire in my pod file
pod 'Alamofire',
:git => 'https://github.com/Alamofire/Alamofire.git',
:branch => 'swift3-rebased'
opened my Project.xcworkspace file and all the compiling errors for Alamofire were gone.
Upgrading to the latest Cocoapods (at the time of this answer: version 1.1.0.beta.2
) via the command:
gem install cocoapods --pre
seemed to solve the issue for my circumstance.
Update the pod to 1.1.0.rc using the below command.
sudo gem install cocoapods
use the blow snippet at the 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
this helps.