more flexible sample apps

This commit is contained in:
Antoine Cœur
2017-10-10 16:42:00 +08:00
parent 308b7c9849
commit 2886108b12
2 changed files with 17 additions and 6 deletions
@@ -68,9 +68,14 @@
NSString *password = _passwordField.text;
BOOL success = [SSZipArchive unzipFileAtPath:_zipPath
toDestination:unzipPath
preserveAttributes:YES
overwrite:YES
nestedZipLevel:0
password:password.length > 0 ? password : nil
error:nil];
error:nil
delegate:nil
progressHandler:nil
completionHandler:nil];
if (success) {
NSLog(@"Success unzip");
} else {
+11 -5
View File
@@ -70,11 +70,17 @@ class ViewController: UIViewController {
}
let password = passwordField.text
let success: Void? = try? SSZipArchive.unzipFile(atPath: zipPath,
toDestination: unzipPath,
overwrite: true,
password: password?.isEmpty == false ? password : nil)
if success != nil {
let success: Bool = SSZipArchive.unzipFile(atPath: zipPath,
toDestination: unzipPath,
preserveAttributes: true,
overwrite: true,
nestedZipLevel: 1,
password: password?.isEmpty == false ? password : nil,
error: nil,
delegate: nil,
progressHandler: nil,
completionHandler: nil)
if success != false {
print("Success unzip")
} else {
print("No success unzip")