Commit 23efb89d authored by Roy Marmelstein's avatar Roy Marmelstein

Updating readme to reflect class new nicer syntax

parent a81c88ac
...@@ -20,8 +20,8 @@ The easiest way to use Zip is through quick functions. Both take local file path ...@@ -20,8 +20,8 @@ The easiest way to use Zip is through quick functions. Both take local file path
```swift ```swift
do { do {
let filePath = NSBundle.mainBundle().URLForResource("file", withExtension: "zip")! let filePath = NSBundle.mainBundle().URLForResource("file", withExtension: "zip")!
let unzipDirectory = try Zip().quickUnzipFile(filePath) // Unzip let unzipDirectory = try Zip.quickUnzipFile(filePath) // Unzip
let zipFilePath = try Zip().quickZipFiles([filePath], fileName: "archive") // Zip let zipFilePath = try Zip.quickZipFiles([filePath], fileName: "archive") // Zip
} }
catch { catch {
print("Something went wrong") print("Something went wrong")
...@@ -36,12 +36,12 @@ do { ...@@ -36,12 +36,12 @@ do {
let filePath = NSBundle.mainBundle().URLForResource("file", withExtension: "zip")! let filePath = NSBundle.mainBundle().URLForResource("file", withExtension: "zip")!
let documentsDirectory = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)[0] as NSURL let documentsDirectory = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)[0] as NSURL
try Zip().unzipFile(filePath, destination: documentsDirectory, overwrite: true, password: "password", progress: { (progress) -> () in try Zip.unzipFile(filePath, destination: documentsDirectory, overwrite: true, password: "password", progress: { (progress) -> () in
print(progress) print(progress)
}) // Unzip }) // Unzip
let zipFilePath = documentsFolder.URLByAppendingPathComponent("archive.zip") let zipFilePath = documentsFolder.URLByAppendingPathComponent("archive.zip")
try Zip().zipFiles([filePath], zipFilePath: zipFilePath, password: "password", progress: { (progress) -> () in try Zip.zipFiles([filePath], zipFilePath: zipFilePath, password: "password", progress: { (progress) -> () in
print(progress) print(progress)
}) //Zip }) //Zip
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment