Search code examples
androidios

Swift Library for Access API


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. Of course I already tried 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?


Solution

  • 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)")
        }
    }