Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
ZIPFoundation basic code
import Foundation
import ZIPFoundation
let fileManager = FileManager()
let currentWorkingPath = fileManager.currentDirectoryPath
var sourceURL = URL(fileURLWithPath: currentWorkingPath)
var destinationURL = URL(fileURLWithPath: currentWorkingPath)
do {
try fileManager.zipItem(at: sourceURL, to: destinationURL)
} catch {
print("Creation of ZIP archive failed with error:\(error)")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment