Go to file
1024jp 1db4e1520e Update Travis CI settings 2016-08-17 23:55:37 +09:00
Documentation Update README 2016-07-29 00:37:51 +09:00
Gzip Support watchOS and tvOS 2016-07-29 01:06:56 +09:00
Gzip.xcodeproj Gather coverage data 2016-08-13 14:02:31 +09:00
Project Change directory structure 2016-07-29 00:27:30 +09:00
Sources Update code for Swift 3.0 beta 6 2016-08-16 17:59:49 +09:00
Tests Fix localizedDescription of GzipError 2016-08-13 14:24:49 +09:00
zlib Use modulemap instead of bridging header 2015-08-31 18:12:48 +09:00
.gitignore Add DS_Store to .gitignore 2015-05-12 00:40:39 +09:00
.travis.yml Update Travis CI settings 2016-08-17 23:55:37 +09:00
CHANGELOG.md Support watchOS and tvOS 2016-07-29 01:06:56 +09:00
LICENSE Rename from "NSData+GZIP" to "Data+Gzip" 2016-07-28 19:35:37 +09:00
README.md Update code for Swift 3.0 beta 6 2016-08-16 17:59:49 +09:00

README.md

GzipSwift

macOS iOS watchOS tvOS Swift Carthage compatible Build Status License

GzipSwift is a framework with an extension of Data written in Swift. It enables compress/decompress gzip using zlib.

  • Requirements: OS X 10.9 / iOS 8 / watchOS 2 / tvOS 9 or later
  • Swift version: 3.0 (beta 6)

Usage

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
}

// check data is gzipped
print(compressedData.isGzipped)

Installation

  1. Build Gzip framework.
  2. In Build Phases, add Gzip.framework library to your project.
  3. import Gzip in your Swift file.
  4. Use in your code.

Lisence

© 2014-2016 1024jp

GzipSwift is distributed under the terms of the MIT License. See LISENCE for details.