Is the a new error in Alamofire 5? as this wasn\'t running into bugs last time. Below are the code which are done. Anyone who used Alamofire facing this?
imp
You can also extract response it this way
AF.request(url, method: HTTPMethod.get, parameters: param as? Parameters)
.responseJSON { response in
if let JSON = response.value {
if response.response?.statusCode == 200{
completionHandler(JSON as AnyObject?, nil)
}else if(response.response?.statusCode == 401){
completionHandler(JSON as AnyObject?, nil)
}
}
else{
if response.response?.statusCode == 401 {
SVProgressHUD.showInfo(withStatus: "Request timed out.")
}
else {
completionHandler(nil,response.error as NSError?)
}
}
}