Swift Package Index


Perfect Zip compression utility.


  • The latest stable release is 3.0.3. Released 2 years ago.
  • The last commit to master was 2 years ago.

Swift Version Compatibility

  • 3.0.3 and master
    5.3
    5.2
    5.1
    5.0
    4.2
Full build results

Platform Compatibility

  • 3.0.3 and master
    iOS
    macOS(Intel)
    macOS(ARM)
    Linux
    tvOS
    watchOS
Full build results

Perfect Zip 简体中文

Perfect Zip utility

This Perfect module wraps the minizip C library and provides simple zip and unzip functionality.

Including in your project

Add this project as a dependency in your Package.swift file.

.Package(url: "https://github.com/PerfectlySoft/Perfect-Zip.git", majorVersion: 3)

Running

The following will zip the specified directory:

import PerfectZip

let zippy = Zip()

let thisZipFile = "/path/to/ZipFile.zip"
let sourceDir = "/path/to/files/"

let ZipResult = zippy.zipFiles(
	paths: [sourceDir], 
	zipFilePath: thisZipFile, 
	overwrite: true, password: ""
)
print("ZipResult Result: \(ZipResult.description)")

To unzip a file:

import PerfectZip

let zippy = Zip()

let sourceDir = "/path/to/files/"
let thisZipFile = "/path/to/ZipFile.zip"

let UnZipResult = zippy.unzipFile(
	source: thisZipFile, 
	destination: sourceDir, 
	overwrite: true
)
print("Unzip Result: \(UnZipResult.description)")

Further Information

For more information on the Perfect project, please visit perfect.org.