Module: Perfect-Zip
enum ZipStatus: Error
Zip status type
case FileNotFound
File not found
case UnzipFail
Unzip fail
case ZipCannotOverwrite
Cannot overwrite Destination
var description: String
User readable description
struct ProcessedFilePath
Custom struct to hold required data
class Zip
Zip class to compress and decompress objects
func init()
init functin. Takes no parameters
func unzipFile(source: String, destination: String, overwrite: Bool, password: String = "") -> ZipStatus
Unzip file
- parameter source: Local file path of zipped file. URL.
- parameter destination: Local file path to unzip to. URL.
- parameter overwrite: Overwrite bool.
- parameter password: Optional password if file is protected.
- throws: Error if unzipping fails or if fail is not found.
func zipFiles(paths: [String], zipFilePath: String, overwrite: Bool, password: String?) -> ZipStatus
Zip files
- parameter paths: Array of URL filepaths.
- parameter zipFilePath: Destination URL, should lead to a .zip filepath.
- parameter overwrite: Overwrite bool.
- parameter password: Password string. Optional.
- throws: Error if zipping fails.