The simplest unzipper just works.
import Piz
...
// create an unzipper with file URL or data
if let piz = Piz(fileURL: url) { // or let piz = Piz(data: data)
// get all file names, including paths if available
let files = piz.files
// check if a file be available
let isFileExisting = piz.contains(file: "path/to/file.ext")
// get data from a file
let data = piz.data(forFile: "path/to/file.ext")
// or if you like subscription
let data = piz["path/to/file.ext"]
}
Swift package only, add this repo URL to your Package.swift
.
test.epub
downloaded from https://code.google.com/p/epub-samples/64.zip
created with https://gist.github.com/gumblex/5573ddb33c21fca4aecfMIT
link |
Stars: 22 |
Last commit: 3 years ago |
Struct, you just hurt me...
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics