From fc037ecd059355dc7f79807a0ab191202d07752b Mon Sep 17 00:00:00 2001 From: Roy Marmelstein Date: Thu, 14 Jan 2016 00:20:15 +0100 Subject: [PATCH] Adding documentation for unzip --- Zip/Zip.swift | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/Zip/Zip.swift b/Zip/Zip.swift index 2b609e3..c4e5fc9 100644 --- a/Zip/Zip.swift +++ b/Zip/Zip.swift @@ -9,10 +9,12 @@ import Foundation import minizip +/// Zip error type public enum ZipError: ErrorType { - case FileNotFound - case UnzipError + case FileNotFound // File not found + case UnzipError // Unzip error + /// Description variable public var description: String { switch self { case .FileNotFound: return NSLocalizedString("File not found.", comment: "") @@ -24,8 +26,24 @@ public enum ZipError: ErrorType { public class Zip { - public init () {} + /** + Init + + - returns: Zip object + */ + public init () { + } + /** + Unzip file + + - parameter path: Path of zipped file. NSURL. + - parameter destination: Path to unzip to. NSURL. + - parameter overwrite: Overwrite bool. + - parameter password: Optional password if file is protected. + + - throws: Error if unzipping fails or if fail is not found. Can be printed with a description variable. + */ public func unzipFile(path: NSURL, destination: NSURL, overwrite: Bool, password: String?) throws { // Check file exists at path. let fileManager = NSFileManager.defaultManager() -- 2.26.2