Categories
Featured iPhone Development Resources iOS Development Libraries Open Source iOS Libraries And Tools Swift

Open Source Swift Networking Library Providing Easy Multi-Part File Uploading

I’ve mentioned a few Swift networking library most recently the python-requests inspired Just library.

Here’s an open source Swift networking library that for large file uploads called Pitaya from JohnLui.

Pitaya features fast multipart uploading, can run asynchronously, and has a nice clean syntax. There is support for basic authorization along with basic file downloading. A set of examples is included.

This code example from the readme shows how to perform a basic file upload:

let file = File(name: "photo", url: NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource("Info", ofType: "plist")!)!)
Pitaya.request(.POST, "http://pitayaswift.sinaapp.com/pitaya.php", files: [file], { (error) -> Void in
    NSLog(error.localizedDescription)
    }) { (string) -> Void in
        println(string)
}

You can find Pitaya on Github here.

A nice library for basic http requests and file uploading.