ZipArchive/SSZipArchive/SSZipArchive+Swift.swift
2016-09-13 09:17:31 +01:00

26 lines
711 B
Swift

//
// SSZipArchive+Swift.swift
// ZipArchive
//
// Created by William Dunay on 7/6/16.
// Copyright © 2016 smumryak. All rights reserved.
//
import Foundation
extension SSZipArchive {
static func unzipFileAtPath(_ path: String, toDestination destination: String, overwrite: Bool, password: String?, delegate: SSZipArchiveDelegate?) throws -> Bool {
var success = false
var error: NSError?
success = __unzipFile(atPath: path, toDestination: destination, overwrite: overwrite, password: password, error: &error, delegate: delegate)
if let throwableError = error {
throw throwableError
}
return success
}
}