more flexible sample apps
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user