response.result.value alamofire 5

118

Alamofire.request("https://jsonplaceholder.typicode.com/todos/1", method: .get)
        .responseJSON { (response) in

            switch response.result {
            case .success(_):
                if let JSON = response.result.value as? [String: Any] {
                    let status = JSON["completed"] as! Bool
                    print(status)
                }



            case .failure(_): break

            }
    }

Comments

Submit
0 Comments