Skip to content

Commit 37433c9

Browse files
authored
Merge pull request marmelroy#100 from jabez1314/master
support swift 4.0
2 parents 8d1efb3 + efbe72c commit 37433c9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Zip/Zip.swift

+9-2
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,15 @@ public class Zip {
165165
let fullPath = destination.appendingPathComponent(pathString).path
166166

167167
let creationDate = Date()
168-
let directoryAttributes = [FileAttributeKey.creationDate.rawValue : creationDate,
169-
FileAttributeKey.modificationDate.rawValue : creationDate]
168+
169+
#if swift(>=4.0)
170+
let directoryAttributes = [FileAttributeKey.creationDate : creationDate,
171+
FileAttributeKey.modificationDate : creationDate]
172+
#else
173+
let directoryAttributes = [FileAttributeKey.creationDate.rawValue : creationDate,
174+
FileAttributeKey.modificationDate.rawValue : creationDate]
175+
#endif
176+
170177
do {
171178
if isDirectory {
172179
try fileManager.createDirectory(atPath: fullPath, withIntermediateDirectories: true, attributes: directoryAttributes)

0 commit comments

Comments
 (0)