How to go about unzipping a file in swift? In Objective-C, I used SSZipArchive and I loved it. As seen in the code below. I suspect if I decide to keep SSZipArchive, I will have to bridge an Objective-C file to my Swift file. Is there any updated third-party, or better yet Apple-Documentation to unzip a file in 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];
Swift 2 (Update):
So it works for me without Errors:
include the library to your Project Swift-ObjC Bridge (xxxx-Bridge-Header.h)
#import "SSZipArchive.h"
link the Library "libz.tbd" - Part of iOS
(Project -> Build Phases -> Link Binary With Libraries -> +)
Ready to zip/unzip