I created a brand new Swift project, then added the following podfile
to it
platform :ios, '8.0'
use_frameworks!
target 'LifeStream' do
pod 'SSKeychain'
pod 'LiveSDK'
pod 'Alamofire', '~> 1.2'
end
target 'LifeStreamTests' do
pod 'SSKeychain'
pod 'LiveSDK'
pod 'Alamofire', '~> 1.2'
end
I then ran pod Install which created my workspace. When it was finished, I compiled the project but received the following compiler errors in the AlamoFire framework.
Cannot subscript a value of type '[String : AnyObject]' with an index of type 'CFString!'
Cannot subscript a value of type '[String : AnyObject]' with an index of type 'CFString!'
Cannot subscript a value of type '[String : AnyObject]' with an index of type 'CFString!'
For the following code in Manager.swift
if let info = NSBundle.mainBundle().infoDictionary {
let executable: AnyObject = info[kCFBundleExecutableKey] ?? "Unknown"
let bundle: AnyObject = info[kCFBundleIdentifierKey] ?? "Unknown"
let version: AnyObject = info[kCFBundleVersionKey] ?? "Unknown"
I also received several other compiler errors in the same file such as
Value of optional type 'NSURLSessionConfiguration?' not unwrapped; did you mean to use '!' or '?'?
self.session = NSURLSession(configuration: configuration, delegate: delegate, delegateQueue: nil)
Missing argument for parameter #2 in call
completionHandler(sessionDidReceiveChallenge!(session, challenge))
There are some other compiler errors in Request.swift as well. My question is, are these a result of changes made in Swift 2.0? If so, is there an ETA as to when Alamofire will have these issues fixed and published?
The answer to this was to use the new
Alamofire Swift-2
branch on github. I adjusted my podfileand re-installed the pods. Once it was done, I was able to build the project without any issues.