Extensive Open Source Swift Based Networking Library

Last month I mentioned a library providng a neat Swift library wrapping much of NSURLSession’s features called SwiftHTTP.

Here’s an open source library from AFNetworking project founder Mattt Thompson providing a more extensive networking written in Swift called Alamofire.

As Mattt states in the readme:

Alamofire is an HTTP networking library written in Swift. Think of it as AFNetworking, reimagined for the conventions of this new language.

The features as stated in the readme include:

Chainable Request / Response methods
URL / JSON / plist Parameter Encoding
Upload File / Data / Stream
Download using Request or Resume data
Authentication with NSURLCredential
Progress Closure & NSProgress
cURL Debug Output

This example from the readme shows the alamoFire syntax on creating a GET request with response string handling:

Alamofire.request(.GET, "http://httpbin.org/get", parameters: ["foo": "bar"])
         .responseString { (request, response, string, error) in
                  println(string)
         }

You can find AlamoFire on Github here.

A great Swift based networking library.

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: Extensive Open Source Swift Based Networking Library

©2014 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Leave a Reply

Your email address will not be published. Required fields are marked *