ZipArchive/README.md

62 lines
1.9 KiB
Markdown
Raw Normal View History

2015-11-08 00:48:00 +08:00
2016-06-01 04:21:33 +08:00
[![Build Status](https://travis-ci.org/ZipArchive/ZipArchive.svg?branch=master)](https://travis-ci.org/ZipArchive/ZipArchive)
# SSZipArchive
2015-04-07 03:44:13 +08:00
2015-07-12 19:32:46 +08:00
ZipArchive is a simple utility class for zipping and unzipping files on iOS and Mac.
2015-04-07 03:44:13 +08:00
2015-10-23 23:52:53 +08:00
- Unzip zip files;
- Unzip password protected zip files;
- Create new zip files;
- Append to existing zip files;
- Zip files;
- Zip-up NSData instances. (with a filename)
2015-04-07 03:44:13 +08:00
2015-10-23 23:52:53 +08:00
## Installation and Setup
2017-07-17 23:59:15 +08:00
*The main release branch is configured to support Objective C and Swift 3. There is a 'swift23' branch which is a tied to a older 1.x release and will not work in Xcode 8 or Xcode 9*
2015-10-23 23:52:53 +08:00
### CocoaPods
`pod install SSZipArchive`
2015-07-12 19:52:18 +08:00
2015-12-21 21:33:41 +08:00
### Carthage
`github "ZipArchive/ZipArchive"`
2015-10-23 23:52:53 +08:00
### Manual
2015-07-12 19:52:18 +08:00
2015-10-23 23:52:53 +08:00
1. Add the `SSZipArchive` and `minizip` folders to your project.
2. Add the `libz` library to your target
SSZipArchive requires ARC.
## Usage
2015-04-07 03:44:13 +08:00
2015-10-24 02:23:12 +08:00
### Objective-C
2015-04-07 03:44:13 +08:00
```objective-c
2015-10-23 23:52:53 +08:00
// Create
[SSZipArchive createZipFileAtPath: zipPath withContentsOfDirectory: sampleDataPath];
// Unzip
[SSZipArchive unzipFileAtPath:zipPath toDestination: unzipPath];
2015-04-07 03:44:13 +08:00
```
2016-09-15 01:33:38 +08:00
### Swift
2015-10-24 02:23:12 +08:00
2015-10-23 23:52:53 +08:00
```swift
// Create
SSZipArchive.createZipFileAtPath(zipPath, withContentsOfDirectory: sampleDataPath)
// Unzip
SSZipArchive.unzipFileAtPath(zipPath, toDestination: unzipPath)
```
## License
SSZipArchive is protected under the [MIT license](https://github.com/samsoffes/ssziparchive/raw/master/LICENSE) and our slightly modified version of [Minizip](http://www.winimage.com/zLibDll/minizip.html) 1.1 is licensed under the [Zlib license](http://www.zlib.net/zlib_license.html).
## Acknowledgments
Big thanks to [aish](http://code.google.com/p/ziparchive) for creating [ZipArchive](http://code.google.com/p/ziparchive). The project that inspired SSZipArchive. Thank you [@randomsequence](https://github.com/randomsequence) for implementing the creation support tech and to [@johnezang](https://github.com/johnezang) for all his amazing help along the way.