Zippy is an iOS framework for reading ZIP files. It's written in Swift 4 and uses Apple's compression framework for decompression.
Please read the TODO section before using it!
- Easy to use
- Support for reading ZIP files using
FileWrapper
orURL
- Support for split ZIP files
- Tests
import Zippy
let fileURL = <URL to file>
let file = try! ZipFile(url: fileURL)
for filename in file {
let data = file[filename]
// Do something with file data…
}
Zippy requires Swift 4 and iOS 10.0 or greater.
-
Make sure CocoaPods is installed and
cd
into your project directory. -
Update your Podfile to include the following
pod 'Zippy'
- Run
pod install
-
Submodule, clone, or download Zippy and drag the Zippy.xcodeproj file into your own project.
-
Select your project file in the Xcode sidebar, then select your target. In the General tab, click the + button under Embedded Binaries.
-
Select Zippy.framework.
-
Add.
The framework should appear under Embedded Binaries and Linked Frameworks and Libraries
Testdata is generated automatically when running the tests for the first time. It's about 640MB big to test the framework with large files. I should probably add an option to skip the large file test…
The framework is already usable, but it still ignores a lot of information in ZIP files. It has not been tested with ZIP files from different sources. Make sure to test it thoroughly before shipping your app.
There is still a lot do to:
- A lot of small stuff (see "// TODO:" in source code)
- Support for password-protected ZIP files
- Creating and editing ZIP files
- Support for more compression algorithms
- More and better tests
- More documentation in code
- Support for macOS (new target and tests)
Feel free to send pull requests or report bugs.