Skip to content
/ Zip Public
forked from marmelroy/Zip

Swift framework for zipping and unzipping files. Support Swift Package Manager.

Notifications You must be signed in to change notification settings

mzying2013/Zip

 
 

Repository files navigation

Zip

Swift framework for zipping and unzipping files. Support Swift Package Manager.

import PackageDescription

let package = Package(
    name: "Demo",
    dependencies: [
        .package(url: "https://github.com/mzying2013/Zip.git", from: "2.0.0")
    ],
    targets: [
        .target(name: "App", dependencies: ["Zip"]),
        .testTarget(name: "AppTests", dependencies: ["App"])
    ]
)

Note

If you want to generate and run an xcode project, you have to add libz.tbd in target of minizip.

Quick functions

The easiest way to use Zip is through quick functions. Both take local file paths as NSURLs, throw if an error is encountered and return an NSURL to the destination if successful.

do {
    let filePath = Bundle.main.url(forResource: "file", withExtension: "zip")!
    let unzipDirectory = try Zip.quickUnzipFile(filePath) // Unzip
    let zipFilePath = try Zip.quickZipFiles([filePath], fileName: "archive") // Zip
}
catch {
  print("Something went wrong")
}

About

Swift framework for zipping and unzipping files. Support Swift Package Manager.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Makefile 49.9%
  • C 40.5%
  • Swift 6.4%
  • C++ 3.2%