Skip to content

Commit 2886108

Browse files
committed
more flexible sample apps
1 parent 308b7c9 commit 2886108

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

ObjectiveCExample/ObjectiveCExample/ViewController.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,14 @@ - (IBAction)unzipPressed:(id)sender {
6868
NSString *password = _passwordField.text;
6969
BOOL success = [SSZipArchive unzipFileAtPath:_zipPath
7070
toDestination:unzipPath
71+
preserveAttributes:YES
7172
overwrite:YES
73+
nestedZipLevel:0
7274
password:password.length > 0 ? password : nil
73-
error:nil];
75+
error:nil
76+
delegate:nil
77+
progressHandler:nil
78+
completionHandler:nil];
7479
if (success) {
7580
NSLog(@"Success unzip");
7681
} else {

SwiftExample/SwiftExample/ViewController.swift

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,17 @@ class ViewController: UIViewController {
7070
}
7171

7272
let password = passwordField.text
73-
let success: Void? = try? SSZipArchive.unzipFile(atPath: zipPath,
74-
toDestination: unzipPath,
75-
overwrite: true,
76-
password: password?.isEmpty == false ? password : nil)
77-
if success != nil {
73+
let success: Bool = SSZipArchive.unzipFile(atPath: zipPath,
74+
toDestination: unzipPath,
75+
preserveAttributes: true,
76+
overwrite: true,
77+
nestedZipLevel: 1,
78+
password: password?.isEmpty == false ? password : nil,
79+
error: nil,
80+
delegate: nil,
81+
progressHandler: nil,
82+
completionHandler: nil)
83+
if success != false {
7884
print("Success unzip")
7985
} else {
8086
print("No success unzip")

0 commit comments

Comments
 (0)