【发布时间】:2014-10-30 13:23:50
【问题描述】:
如何快速解压缩文件?在 Objective-C 中,我使用了 SSZipArchive,我喜欢它。如下面的代码所示。我怀疑如果我决定保留 SSZipArchive,I will have to bridge an Objective-C file to my Swift file. 是否有任何更新的第三方,或者更好的 Apple-Documentation 可以在 Swift 中解压缩文件?
NSString *zipPath = [self.globalFileStrucure stringByAppendingPathComponent:@"zipfile.zip"];
[data writeToFile:zipPath options:0 error:&error];
BOOL unZipped = 0;
unZipped = [SSZipArchive unzipFileAtPath:zipPath toDestination:self.globalFileStrucure];
【问题讨论】:
-
pod 'SSZipArchive'与 Swift 完全兼容。
标签: ios objective-c swift unzip ssziparchive