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:
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.
Original article: Open Source Swift Zip/Unzip Library Supporting Errors, Progress Checking And More
©2016 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.