diff --git a/Zip.playground.xcworkspace/Playground.playground/Contents.swift b/Zip.playground.xcworkspace/Playground.playground/Contents.swift new file mode 100644 index 00000000..51cd7787 --- /dev/null +++ b/Zip.playground.xcworkspace/Playground.playground/Contents.swift @@ -0,0 +1,26 @@ +import PlaygroundSupport +import Zip + +let pdfsFile = (filename: "PDFs", extension: "zip") + +guard let source = Bundle.main.url(forResource: pdfsFile.filename, + withExtension: pdfsFile.extension) +else { + preconditionFailure("Could not find \(pdfsFile.filename).\(pdfsFile.extension)") +} + +let destination = playgroundSharedDataDirectory + .appendingPathComponent("Unzipped") + .appendingPathComponent(pdfsFile.filename, isDirectory: true) + +do { + try Zip.unzipFile(source, destination: destination, + overwrite: true, password: nil) + print("Successfully unzipped \(pdfsFile.filename).\(pdfsFile.extension)") +} catch { + assertionFailure(""" + If the following error is "Zip.ZipError error 1", then you must create the `playgroundSharedDataDirectory` by running the command: + `mkdir ~/Documents/"Shared Playground Data/"` + Failed due to the following error: \(error.localizedDescription) + """) +} diff --git a/Zip.playground.xcworkspace/Playground.playground/Resources/PDFs.zip b/Zip.playground.xcworkspace/Playground.playground/Resources/PDFs.zip new file mode 100644 index 00000000..2a8d55c6 Binary files /dev/null and b/Zip.playground.xcworkspace/Playground.playground/Resources/PDFs.zip differ diff --git a/Zip.playground.xcworkspace/Playground.playground/contents.xcplayground b/Zip.playground.xcworkspace/Playground.playground/contents.xcplayground new file mode 100644 index 00000000..5da2641c --- /dev/null +++ b/Zip.playground.xcworkspace/Playground.playground/contents.xcplayground @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Zip.playground.xcworkspace/Playground.playground/playground.xcworkspace/contents.xcworkspacedata b/Zip.playground.xcworkspace/Playground.playground/playground.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..5bdd6824 --- /dev/null +++ b/Zip.playground.xcworkspace/Playground.playground/playground.xcworkspace/contents.xcworkspacedata @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Zip.playground.xcworkspace/contents.xcworkspacedata b/Zip.playground.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..808c2868 --- /dev/null +++ b/Zip.playground.xcworkspace/contents.xcworkspacedata @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Zip.playground.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Zip.playground.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/Zip.playground.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + +