culturetown b49f3ca4ab jidu commit | vor 11 Monaten | |
---|---|---|
.. | ||
Sources | vor 11 Monaten | |
LICENSE | vor 11 Monaten | |
README.md | vor 11 Monaten |
GzipSwift is a framework with an extension of Data written in Swift. It enables compress/decompress gzip using zlib.
import Gzip
// gzip
let compressedData: Data = try! data.gzipped()
let optimizedData: Data = try! data.gzipped(level: .bestCompression)
// gunzip
let decompressedData: Data
if data.isGzipped {
decompressedData = try! data.gunzipped()
} else {
decompressedData = data
}
Gzip.framework
to your project.Gzip.framework
to the Embedded Binaries section.
import Gzip
in your Swift file and use in your code.GzipSwift is Carthage compatible. You can easily build GzipSwift adding the following line to your Cartfile
:
github "1024jp/GzipSwift"
GzipSwift is available through CocoaPods. To install
it, simply add the following line to your Podfile
:
pod 'GzipSwift'
Install zlib if you haven't installed yet:
$ apt-get install zlib-dev
swift build
© 2014-2019 1024jp
GzipSwift is distributed under the terms of the MIT License. See LICENSE for details.