Skip to content
forked from cxa/Piz

Unzip single, unencrypted, non-zip64 zip files, written in Swift

License

Notifications You must be signed in to change notification settings

iseebi/SimpleUnzipper

Repository files navigation

SimpleUnzipper

Unzip single, unencrypted (no password), non-zip64 (large than 4GB) files. Simple and efficient.

Installation

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.

General 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.

Build Settings Example

If you add SimpleUnzipper inside your project dirctory, the Import Paths should be $(SRCROOT)/SimpleUnzipper

Example

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")
  
}

About Me

  • 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.

Credits

Test example file test.epub is downloaded from https://code.google.com/p/epub-samples/

License

Under the MIT license. See the LICENSE file for more information. For non attributed commercial lisence, please contact me.

About

Unzip single, unencrypted, non-zip64 zip files, written in Swift

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 95.3%
  • Objective-C 4.6%
  • C 0.1%