Alamofire not working (Swift/Xcode 8)

Michael Lee picture Michael Lee · Jul 6, 2016 · Viewed 7.7k times · Source

I am getting the following errors when trying to import Alamofire into my project (Cocoapods isn't working for me, so I have to manually import it).

Anyway, I'm using XCode 8 and Swift 2.3, and I'm getting these errors:

Use of unresolved identifier kSecTrustResultProceed

Contextual type AnyObject cannot be used with array literal

Update: I cleaned XCode, downloaded the latest version of Alamofire and restarted my computer. Now, XCode seems to be giving me conflicting errors (pictures for reference) Cannot force unwrap value of non-optional type String Value of optional type String? not unwrapped Thanks!

Answer

TotoroTotoro picture TotoroTotoro · Sep 9, 2016

As of early September '16, you need to use the following in your Podfile:

pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :tag => '3.5.0'

Pointing to the swift2.3 branch no longer works, as that branch has been deleted. The tag '3.5.0' points to the last revision on master that supports Swift 2.3.