Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

which is easy to use Afnetworking/Nsurlsession/Alamofire [closed]

I want to make rest api call. I m confused to use Afnetworking or NSurlsession or alamofire with SWIFT 3.0. Can anyone suggest me to use which one.

like image 903
Jatt_Programmer Avatar asked Mar 10 '23 17:03

Jatt_Programmer


2 Answers

NSURLSession is newer than NSURLConnection, if you are using swift language then you can use your own custom methods by using NSURLSession or you can use Alamofire.

The NSURLConnection used in AFNetworking frameworks, If you are using objective - c then you can use it, that means not that you cannot use NSURLSession.

NSURLSession launch after iOS 7.0 or 8.0. It is more efficient that NSURLConnection.

At last, If you want to make your own custom API framework then you can use NSURLSession(for swift)(I also used this).

If you don't required the custom framework then use Alamofire Framework.

For more details you can refer this link:

What are the difference among NSURLConnection, NSURLSession and AFNetworking?

like image 145
Gourav Joshi Avatar answered Mar 24 '23 17:03

Gourav Joshi


For Swift 3.0 Alamofire is best because it is well Optimized and also reusable and it has also many Build in features.

If You are using Objective- C then you can use AFNetworking.

AFNetworking and Alamofire are from same Developers but in Different Languages.

like image 30
Gurinder Batth Avatar answered Mar 24 '23 16:03

Gurinder Batth