diff --git a/ObjectiveCExample/ObjectiveCExample/ViewController.m b/ObjectiveCExample/ObjectiveCExample/ViewController.m index 8ddbad2..6bdff25 100644 --- a/ObjectiveCExample/ObjectiveCExample/ViewController.m +++ b/ObjectiveCExample/ObjectiveCExample/ViewController.m @@ -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 { diff --git a/SwiftExample/SwiftExample/ViewController.swift b/SwiftExample/SwiftExample/ViewController.swift index 7a8404d..541b834 100644 --- a/SwiftExample/SwiftExample/ViewController.swift +++ b/SwiftExample/SwiftExample/ViewController.swift @@ -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")