![Post Category Post Category](http://maniacdev.com/wp-content/plugins/maxblogpress-bring-my-blog-visitors-back/bmbvb-lib/images/category-icon.png)
A couple of weeks ago I mentioned a library providing a a nice clean syntax for working with JSON in Swift.
Here’s a Swift library that wraps NSURLSession providing a simplifed syntax called SwiftHTTP from Dalton Cherry.
SwiftHTTP provides a nice clean syntax for GET, POST, PUT, DELETE and HEAD requests with base URL parameter for easier RESTful API interaction. There is also support for request nad repsonse serialization.
Here’s an example from the readme showing a basic GET request:
request.HEAD("http://domain.com/image.png", parameters: nil, success: {(response: AnyObject?) -> Void in
println("The file does exist!")
},failure: {(error: NSError) -> Void in
println("File not found: (error)")
})
You can find SwiftHTTP on Github here.
A nice library for cleaner HTTP interaction in Swift.
- An Open Source Library That Makes Working With JSON Data Using Swift Much Easier
- An Open Source Swift Library For Easily Creating Much More Useful Logging Statements
- Open Source Functional Programming Toolbelt For Swift Inspired By The Underscore.js Library
- Tutorial: Creating A Candy Crush Style Game In Swift With Sprite Kit
- Open Source iOS Component For Creating Great Looking Custom Alert Views Made With Swift
Original article: Open Source Swift Library Simplifying Use Of NSURLSession
©2014 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.