Ios swift – Determine version number of Alamofire programatically?
I am using Alamofire in my app and I would like to print the version number to the logs during app start. Is there a way to access the version number programatically?
I am using Alamofire in my app and I would like to print the version number to the logs during app start. Is there a way to access the version number programatically?
I would like to know how can I test multipart sending params with Alamofire (network stack). Ex: send a string with an image (Data type). My issue is that when I receive a response, I get the URLRequest and I…
I have old code from team where they were failing to parse Bool response. NetworkManager.shared().executeWith(request: APIRouter.firebasetoken(param)) { (httpResponse, jsonData, error) in if httpResponse?.statusCode == 200 { guard let json = jsonData else {return} if let isSuccess = json.bool, isSuccess ==…
Alamofire has an extension on UIImageView that makes loading an image very easy. But, for unit testing my code, I would like to mock the result of the response, so that I can test success and failure. How can I…
I am getting JSON data from an api and I am not able to populate it to the tableview. API Response { "inspection_data": [{ "inspection_dt_card": "February 02, 12:17AM", "part_type_card": "XXYYZZ1", "inspection_status_card": "Bad", "defect_type_card": "EXTR", "badge_color": "danger", "line_id": "line-86" }, {…
Trying out the request on Postman, the "data" of the response is an empty dictionary. However, when I try that in swift using Alamofire, "data" gets misinterpreted as an empty array. What could I be doing wrong? Raw response using…
I was trying to wrap Alamofire with async, but the answers that I found couldn't help me, but after finding the solution, I thought that I should help some one with this same problem.
I have the following function: func executeGet( completion: @escaping (Data?, Error?) -> Void) { AF.request("https:URL", method:.get, headers:headers).response{ response in debugPrint(response) if let error = response.error { completion(nil, error) } else if let jsonArray = response.value as? Data{ completion(jsonArray, nil) }…
As the title says, I have a function with these parameters: typealias Handler = (Swift.Result<Any?, APIErrors>) -> Void func viewApi (ownerId: String, accessToken: String, completionHandler: @escaping Handler ){ var viewArray: [Information] = [Information]() let headers: HTTPHeaders = [ .authorization("Bearer (accessToken)")…
I am trying to hit alamofire post request but, Getting Request failed with error responseSerializationFailed ( reason: Alamofire.AFError.ResponseSerializationFailureReason.jsonSerializationFailed ( error: Error Domain=NSCocoaErrorDomain Code=3840 "Invalid value around line 1, column 0." UserInfo={NSDebugDescription=Invalid value around line 1, column 0., NSJSONSerializationErrorIndex=0})). Please help…