Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
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.
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?
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.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
Currently i am doing IOS App Development and my projects works under AFNetworking Lib V3.2.1 also i am slowly migrating my app into the Swift with AutoLayout.
My clarification whether will get the AFNetworking Next version for Objective-C?. Because this lib last they was updated on May 2018 and its getting older now a days.
Better can I switch over my project into Swift with alamofire network lib.?
Suggestion require to proceed further.
For Objective-C there will be no further updates. Apple now recommends to use swift in every project so why go for objective-c now as its old. Alamofire is very good wrapper written for networking.
I would suggest you to start migrating your project to Swift by using Bridging-Header which serves purpose of using Swift & Objective-C in same project.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am building a mobile app that requires some waivers for to be signed. Now I decided to go through Docusign in order to get electronic signatures but the do not seem to have any SDKs or tutorials for integration using swift language. Is there any way to integrate DocuSign with my app being completely composed of swift? Thanks.
When writing in Swift you can use obj-C code. Use a bridging header to include obj-c code to your swift project.
I don't know anything about Docusign, but if they have a obj-c SDK, you can use it in your project.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
For a new app I am designing I want to implement a Request Manager Class (swift) that will handle all the calls to the backend.
Which is the right way to do it? Class Methods or a Singleton and can you please provide me with a pattern or some sample code for me to get started?
Thank you in advance
First of all use Alamofire instead of AFNetworking. Alamofire was made by the same team as AFNetworking, but it's written in pure Swift.
Singleton pattern is a good choice for APIClient. My approach is to make generic wrapper on Alamofire which handles requests with unified error handling and completions, takes care of authentication headers and stuff.
Next step is to extend generic wrapper (i.e by subclassing) to handle application's domain-specific behavior -> all calls that connects to API goes here.
Big plus of this approach is fact that you can reuse this generic wrapper in another app.
Try Alamofire (AFNetworking for swift)
Alamofire.request(.POST, "http:/www.abc.com" , parameters: ["consumer_key": "Og5pRGI2V"]).responseJSON { response in
print(response)
}
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have been using AFNetworking for a while, however recently heard opinion NSUrlSession provides the same functionality as AFNetworking, so no need to use AFNetworking. Mostly I'm interested in these features like operations, clients and lazy image down-loader, however, not sure how much additional code I will need to write. Has anybody transitioned from AFNetworking to NSUrlSession?
NSURLSession does not reproduce all of the richness of AFNetworking (notably, the construction of complex HTTP requests and the simplified parsing of the responses). So if you're leveraging these features of AFNetworking, then you might want to stay with AFNetworking.
For the programmer who is currently using NSURLConnection, though, NSURLSession offers some nice enhancements. The block-based methods of NSURLSession are richer than what was provided by NSURLConnection. Also, NSURLSession offers background session features that allow requests to continue even if the app isn't running.
For the AFNetworking developer using AFHTTPRequestOperationManager (which is NSURLConnection-based), AFNetworking now offers AFHTTPSessionManager, a very similar interface that leverages NSURLSession internally (but, curiously, not NSOperationQueue-based). So, if you want to enjoy some NSURLSession features with AFNetworking, consider using AFHTTPSessionManager instead of AFHTTPRequestOperationManager.
AFNetworking is written on top of NSUrlSession hence no reason to go away from it unless you want to handle all of the implementation details which AFNetworking has already taken care of for you and more to the point it is tested by thousands of users on a daily basis hence is a pretty stable and mature library.
I don't use it as I know the inner workings of the native NSUrlConnection and NSUrlSession, but for most people AFNetworking 2.X is much easier to work with. I wasn't a fan of AFNetworking 1.X which is why I got deeply into doing it myself before 2.X was available.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Is it possible to write apps in pure Objective C in iOS 8 (not using Swift at all), because I don't feel like learning Swift for the moment?
Yes. In fact I recommend you use Objective-c for the time being. Swift isn't finished yet and it will surely change over the time, until it matures. Also, concerning the iOS Apis they are written in Objective-C and adapted to work in Swift. There is a great inconsistency between data types used by the iOS Swift Apis(they use the Objective-c data types instead of the native Swift ones). From my experience (I started developing and learning swift this month), it's best to stick to Objective-c for now.
Yes surely you can do to do that select new project and select Objective C in place of Swift