I am using Alamofire for network handling in swift and run into one weird error. It seems like we can't pass Method enum as parameter.
[Error is on Method parameter]
private func apiRequest(method: Method, url: String, apiData: [String : AnyObject], completion:(finished: Bool, response: AnyObject?) ->Void) {
Alamofire.request(method, url, parameters: apiData).responseJSON{ response in
if let JSON = response.result.value {
completion(finished: true, response: JSON)
} else {
completion(finished: false, response:nil)
}
}
}
You have to specify the module from which to lookup object type.
Call Alamofire.Method