From 4a71be9cb2a35725b427718f67d54dea9e697e93 Mon Sep 17 00:00:00 2001 From: jabez Date: Fri, 15 Sep 2017 12:40:40 +0800 Subject: [PATCH] support swift 4.0 --- Zip/Zip.swift | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Zip/Zip.swift b/Zip/Zip.swift index a2eb115..981f632 100644 --- a/Zip/Zip.swift +++ b/Zip/Zip.swift @@ -165,8 +165,15 @@ public class Zip { let fullPath = destination.appendingPathComponent(pathString).path let creationDate = Date() - let directoryAttributes = [FileAttributeKey.creationDate.rawValue : creationDate, - FileAttributeKey.modificationDate.rawValue : creationDate] + + #if swift(>=4.0) + let directoryAttributes = [FileAttributeKey.creationDate : creationDate, + FileAttributeKey.modificationDate : creationDate] + #else + let directoryAttributes = [FileAttributeKey.creationDate.rawValue : creationDate, + FileAttributeKey.modificationDate.rawValue : creationDate] + #endif + do { if isDirectory { try fileManager.createDirectory(atPath: fullPath, withIntermediateDirectories: true, attributes: directoryAttributes) -- 2.26.2