I am currently in the process of updating my codebase to Swift 3.0, and I am using Alamofire.
Thus, I had to update Alamofire to 4.0 (Alamofire git repo).
I have a request method to fetch data from the server, and before migration, it worked wonderfully.
After using Xcode's migration tool, I ended up with this error : "Extra argument in Call"
.
I'm not quite sure why this method is no longer working.
Any help would be wonderful!
class func makeRequest(
_ method: RequestMethod,
authorization: String?,
uri: String,
params: JSONDictionary?,
retry: Bool = true,
completionHandler: @escaping RequestCompletionBlock)
{
let requestURL = baseURL + uri
let authHeader: Dictionary<String, String>? = authorization != nil ? ["Authorization" : authorization!] : nil
//requestURL is highlighted, says "Extra argument in call"
sharedAlamofireManager.request(Method(rawValue: method.rawValue)!, requestURL, parameters: params, encoding: .JSON, headers: authHeader).responseJSON {
response in
}
}
Migration Guide for Alamofire4.0
Edit: JSONDictionary:
typealias JSONDictionary = Dictionary<String, Any>
sharedAlamoFireManager is also a SessionManager