I'm new in iOS development. I have a little experience in Android development and wanna to learn iOS development. In Android i use Retrofit library to access API.
And now i want to know kind of library for access API. I want to discuss about API library that have good performance, easy to use, and easy to understand. yeah of course i already try to find it and i get it :
https://medium.com/ios-os-x-development/restkit-tutorial-how-to-fetch-data-from-an-api-into-core-data-9326af750e10
But i need more idea about library for access API, can anyone help me?
Thank you.
you can Alamofire in ios.
Alamofire.request("https://httpbin.org/get").responseJSON { response in
print(response.request) // original URL request
print(response.response) // HTTP URL response
print(response.data) // server data
print(response.result) // result of response serialization
if let JSON = response.result.value {
print("JSON: \(JSON)")
}
}
Even though Alamofire might seem like a good choice for networking, the native URLSession along with the Codable protocol provide the same functionality without adding any dependencies to your project.
let task = URLSession.shared.dataTask(with: url) { data, response, error in
// Handle data, response, and error
}
task.resume()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With