Swift Alamofire VS AFNetworking

2019-02-01 08:55发布

I am developing an app using Swift. I want to call a REST API. I found there are two popular libraries, AFNetworking and Alamofire. But I don't know which is better (is more popular or has more features).

Can anybody suggest what are the main differences between Alamofire and AFNetworking?

4条回答
劫难
2楼-- · 2019-02-01 09:34

AFNetworking:

  • This is the objective -C version of the library.
  • This is very powerful and you could install this in your Swift project and use it as a bridge to the swift project.

Alamofire:

  • This is the Swift version of AFNetworking.
  • But not all the features of AFNetworking are included.

If you are good at Objective-C use AFNetworking. If not, use Alamofire. It is simple and many resources are available for Swift.

查看更多
混吃等死
3楼-- · 2019-02-01 09:38

Use AFNetworking if you use Objective-C

Use Alamofire if you use Swift

查看更多
乱世女痞
4楼-- · 2019-02-01 09:51

AFNetworking and Alamofire are by the same people (the Alamofire Software Foundation), Alamofire is their Swift version whereas AFNetworking is the Objective-C version.

Feature wise they are the same.

查看更多
Evening l夕情丶
5楼-- · 2019-02-01 09:56

If you are developing app using Objective-C then you must go with the AFNetworking.

Other wise if you are developing with the Swift then try the latest release of Alamofire.

In both the libraries Networking is done asynchronously. Only difference is Alamofire is no longer supported on iOS 7 due to the lack of support for frameworks.

查看更多
登录 后发表回答