Unzip single, unencrypted (no password), non-zip64 (large than 4GB) files. Simple and efficient.
SimpleUnzipper
is encapsulated as a framework. Drag SimpleUnzipper.xcodeproj
into your project, add libz.dylib
and SimpleUnzipper
to “Linked Frameworks and Libraries” under “General” tab of target settings.
The most important step, don't forget to add correct path which contains SimpleUnzipper
to target's Build Settings
-> Swift Compiler - Search Paths
-> Import Paths
. As below shows, SimpleUnzipper
is on the same directory as the target project.
If you add SimpleUnzipper
inside your project dirctory, the Import Paths
should be $(SRCROOT)/SimpleUnzipper
SimpleUnzipper is very simple as its name, contains only a few public properties and methods.
import SimpleUnzipper
...
// create an unzipper with file URL or data
if let unzipper = SimpleUnzipper(fileURL: url) {
// or SimpleUnzipper(data: data)
// get all file names, including paths if available
let files = unzipper.files
// check if a file available
let isAvailable = unzipper.containsFile("path/to/file.ext")
// get data from a file
let data = unzipper.dataForFile("path/to/file.ext")
}
- Twitter: @_cxa
- Apps available in App Store: http://lazyapps.com
- PayPal: xianan.chen+paypal 📧 gmail.com, buy me a cup of coffee if you find it's useful for you.
Test example file test.epub
is downloaded from https://code.google.com/p/epub-samples/
Under the MIT license. See the LICENSE file for more information. For non attributed commercial lisence, please contact me.