Get Updates By E-mail 

Article Written By:
Johann Dowa

Open Source Swift Zip/Unzip Library Supporting Errors, Progress Checking And More

  •  
  •  
  •  
  •  
  •  

About ta year and a half ago I mentioned an objective-c library for accessing data within zip files.

Here’s an open source Swift library from Roy Marmelstein providing a nice clean syntax for basic and advanced file zipping and unzipping.

Zip allows you to zip/unzip from specified paths, and will throw an error if unsuccessful. You can also work with password protected zip files, and even provide progress updates.

Here’s a code snippet from the readme showing the basic Zip syntax:

do {
    let filePath = NSBundle.mainBundle().URLForResource("file", withExtension: "zip")!
    let unzipDirectory = try Zip.quickUnzipFile(filePath) // Unzip
    let zipFilePath = try Zip.quickZipFiles([filePath], fileName: "archive") // Zip
}
catch {
  print("Something went wrong")
}

You can find Zip on Github here.

A nice library for working with zip files in Swift.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments