ZipArchive 是一个用于在 iOS 和 Mac 上压缩和解压缩文件的简单实用工具类。
SSZipArchive
和 minizip
文件夹添加到您的项目中。libz
库添加到您的目标SSZipArchive 需要ARC。
// Create
[SSZipArchive createZipFileAtPath: zipPath withContentsOfDirectory: sampleDataPath];
// Unzip
[SSZipArchive unzipFileAtPath:zipPath toDestination: unzipPath];
// Create
SSZipArchive.createZipFileAtPath(zipPath, withContentsOfDirectory: sampleDataPath)
// Unzip
SSZipArchive.unzipFileAtPath(zipPath, toDestination: unzipPath)
SSZipArchive 在 MIT 许可证下受保护,我们的略有修改的 Minizip 1.1 版本在 zlib 许可证下授权。
衷心感谢 aish 为创建 ZipArchive 所做的工作。该项目启发了 SSZipArchive。感谢 @randomsequence 实现创建支持技术,以及 @johnezang 在整个过程中的所有了不起的帮助。