質問

I'm planning to build a simple social app that can allow users to send pictures and text messages. By doing some research I found some people use Backend as a Service(BaaS) to manage database on the server while some people use AFNetworking.

I have two questions that might seem stupid to you:

  1. My iOS programming book used NSURL + NSURLRequest + NSURLSessionTask + NSURLSession to get JSON data from network, why do a lot of people use this third party API AFNetworking?

  2. What's the benefit of using AFNetworking(vs Baas)? Do I have to write my own server code if I use AFNetworking?

Thanks!

役に立ちましたか?

解決

These are technologies that operate at different layers. You can assemble an architecture using a combination of these.

AFNetworking is a good drop-in replacement for NSURL + NSURLRequest + NSURLSessionTask + NSURLSession. It's a client-side networking framework. It's a good choice if you write your own web server.

Most BaaS platforms have web APIs. AFN would work well with those. So would NSURL*.

Some BaaS platforms like Firebase offer an iOS SDK. In that case you could use the SDK instead of AFN or NSURL*.

他のヒント

AFNetworking is just a delightful library that wraps NSURLSession and its ilk. You can use AFNetworking in almost any situation that you can use Apple's APIs.

I like AFNetworking because it tends to simplify making networking calls to a few lines of code.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top