Commit a97fe9b9 authored by Roy Marmelstein's avatar Roy Marmelstein Committed by GitHub

Merge pull request #37 from gwjakewelton/swift3.0

Xcode 8 Beta 6 Fixes (Swift 3.0)
parents 376f3efa 233effd7
......@@ -692,6 +692,7 @@
SUPPORTED_PLATFORMS = "appletvsimulator appletvos";
SWIFT_INCLUDE_PATHS = "${SRCROOT}/Zip/minizip/**";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
......@@ -717,6 +718,7 @@
SUPPORTED_PLATFORMS = "appletvsimulator appletvos";
SWIFT_INCLUDE_PATHS = "${SRCROOT}/Zip/minizip/**";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
......@@ -742,6 +744,7 @@
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_INCLUDE_PATHS = "${SRCROOT}/Zip/minizip/**";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
......@@ -766,6 +769,7 @@
SKIP_INSTALL = YES;
SWIFT_INCLUDE_PATHS = "${SRCROOT}/Zip/minizip/**";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
};
name = Release;
};
......
......@@ -10,7 +10,7 @@
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "F3707899-72AE-49DA-9BDD-5CB0B64CF03A",
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
"8DA5B175D3FDB92A3B3CCBD4109A734F1316A3DD" : "Zip\/Zip\/minizip\/",
"3DD768C8AB2D6A2647C9EF99992D3CC5820E77C4" : "Zip-swift3\/"
"3DD768C8AB2D6A2647C9EF99992D3CC5820E77C4" : "Zip\/"
},
"DVTSourceControlWorkspaceBlueprintNameKey" : "Zip",
"DVTSourceControlWorkspaceBlueprintVersion" : 204,
......
......@@ -37,7 +37,7 @@ extension Zip {
- returns: NSURL of the destination folder.
*/
public class func quickUnzipFile(_ path: URL, progress: ((progress: Double) -> ())?) throws -> URL {
public class func quickUnzipFile(_ path: URL, progress: ((_ progress: Double) -> ())?) throws -> URL {
let fileManager = FileManager.default
let fileExtension = path.pathExtension
......@@ -85,10 +85,10 @@ extension Zip {
- returns: NSURL of the destination folder.
*/
public class func quickZipFiles(_ paths: [URL], fileName: String, progress: ((progress: Double) -> ())?) throws -> URL {
public class func quickZipFiles(_ paths: [URL], fileName: String, progress: ((_ progress: Double) -> ())?) throws -> URL {
let fileManager = FileManager.default
let documentsUrl = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] as URL
let destinationUrl = try! documentsUrl.appendingPathComponent("\(fileName).zip")
let destinationUrl = documentsUrl.appendingPathComponent("\(fileName).zip")
try self.zipFiles(paths, zipFilePath: destinationUrl, password: nil, progress: progress)
return destinationUrl
}
......
......@@ -62,7 +62,7 @@ public class Zip {
- notes: Supports implicit progress composition
*/
public class func unzipFile(_ zipFilePath: URL, destination: URL, overwrite: Bool, password: String?, progress: ((progress: Double) -> ())?) throws {
public class func unzipFile(_ zipFilePath: URL, destination: URL, overwrite: Bool, password: String?, progress: ((_ progress: Double) -> ())?) throws {
// File manager
let fileManager = FileManager.default
......@@ -112,7 +112,7 @@ public class Zip {
throw ZipError.unzipFail
}
var fileInfo = unz_file_info64()
memset(&fileInfo, 0, sizeof(unz_file_info.self))
memset(&fileInfo, 0, MemoryLayout<unz_file_info>.size)
ret = unzGetCurrentFileInfo64(zip, &fileInfo, nil, 0, nil, 0, nil, 0)
if ret != UNZ_OK {
unzCloseCurrentFile(zip)
......@@ -179,7 +179,7 @@ public class Zip {
// Update progress handler
if let progressHandler = progress{
progressHandler(progress: (currentPosition/totalSize))
progressHandler((currentPosition/totalSize))
}
progressTracker.completedUnitCount = Int64(currentPosition)
......@@ -188,7 +188,7 @@ public class Zip {
// Completed. Update progress handler.
if let progressHandler = progress{
progressHandler(progress: 1.0)
progressHandler(1.0)
}
progressTracker.completedUnitCount = Int64(totalSize)
......@@ -209,7 +209,7 @@ public class Zip {
- notes: Supports implicit progress composition
*/
public class func zipFiles(_ paths: [URL], zipFilePath: URL, password: String?, progress: ((progress: Double) -> ())?) throws {
public class func zipFiles(_ paths: [URL], zipFilePath: URL, password: String?, progress: ((_ progress: Double) -> ())?) throws {
// File manager
let fileManager = FileManager.default
......@@ -291,7 +291,7 @@ public class Zip {
// Update progress handler
if let progressHandler = progress{
progressHandler(progress: (currentPosition/totalSize))
progressHandler((currentPosition/totalSize))
}
progressTracker.completedUnitCount = Int64(currentPosition)
......@@ -305,7 +305,7 @@ public class Zip {
// Completed. Update progress handler.
if let progressHandler = progress{
progressHandler(progress: 1.0)
progressHandler(1.0)
}
progressTracker.completedUnitCount = Int64(totalSize)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment