由于 SSZipLibrary 存储库的维护不足,我们决定创建此分支。此分支将独立于 SSZipLibrary 进行维护,因此我们没有从 SSZipLibrary 提取更改的计划。
请随意为 PDKTZipLibrary 贡献
PDKTZipArchive 是一个用于压缩和解压缩文件的简单实用程序类。
您可以执行以下操作
PDKTZipArchive
和 minizip
目录添加到您的项目中。libz
库添加到您的目标中PDKTZipArchive 需要 ARC。
// Unzipping
NSString *zipPath = @"path_to_your_zip_file";
NSString *destinationPath = @"path_to_the_folder_where_you_want_it_unzipped";
[PDKTZipArchive unzipFileAtPath:zipPath toDestination:destinationPath];
// Zipping
NSString *zippedPath = @"path_where_you_want_the_file_created";
NSArray *inputPaths = [NSArray arrayWithObjects:
[[NSBundle mainBundle] pathForResource:@"photo1" ofType:@"jpg"],
[[NSBundle mainBundle] pathForResource:@"photo2" ofType:@"jpg"]
nil];
[PDKTZipArchive createZipFileAtPath:zippedPath withFilesAtPaths:inputPaths];
// Zipping directory
[PDKTZipArchive createZipFileAtPath:zippedPath withContentsOfDirectory:inputPath];
PDKTZipArchive 在 MIT 许可证下受到保护,以及我们略微修改的版本 Minizip 1.1 在 Zlib 许可证下许可。
感谢 aish 创建 ZipArchive。该项目启发了 PDKTZipArchive。感谢 @randomsequence 实现创建支持技术和 @johnezang 在整个过程中的所有出色帮助。