Latest 4.0.0-beta.2
Homepage https://github.com/1024jp/GzipSwift
License MIT
Platforms osx 10.9, ios 8.0, watchos 2.0, tvos 9.0, requires ARC
Authors

GzipSwift

[Swift]()
[platform]()
Carthage compatible
SPM compatible
CocoaPods compatible
Build Status
codecov.io
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: Swift 3.0.1

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
}

Installation

  1. Open Gzip.xcodeproj on Xcode and build Gzip framework for your target platform.
  2. Append the built Gzip.framework to your project.
  3. Go to General pane of the application target in your project. Add Gzip.framework to the Embedded Binaries section.

  4. import Gzip in your Swift file and use in your code.

Carthage

GzipSwift is Carthage compatible. You can easily build GzipSwift adding the following line to your Cartfile:

github "1024jp/GzipSwift"

CocoaPods

GzipSwift is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'GzipSwift'

Swift Package Manager

  1. First you need to install zlib if you haven’t installed yet:

    $ apt-get install zlib-dev
  2. Add this package to your package.swift.
  3. If Swift build failed with a linker error:
    • check if libz.so is in your /usr/local/lib
    • if no, reinstall zlib as step (1)
    • if yes, link the library manually by passing ‘-Xlinker -L/usr/local/lib’ with swift build

Lisence

© 2014-2017 1024jp

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

Latest podspec

{
    "name": "GzipSwift-beta",
    "version": "4.0.0-beta.2",
    "summary": "Swift framework that enables gzip/gunzip Data using zlib.",
    "homepage": "https://github.com/1024jp/GzipSwift",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "1024jp": "[email protected]"
    },
    "social_media_url": "https://twitter.com/1024jp",
    "source": {
        "git": "https://github.com/1024jp/GzipSwift.git",
        "tag": "4.0.0-beta.2"
    },
    "source_files": "Sources/*.swift",
    "module_name": "Gzip",
    "platforms": {
        "osx": "10.9",
        "ios": "8.0",
        "watchos": "2.0",
        "tvos": "9.0"
    },
    "requires_arc": true,
    "libraries": "z",
    "pod_target_xcconfig": {
        "APPLICATION_EXTENSION_API_ONLY": "YES"
    },
    "pushed_with_swift_version": "4.0.0"
}

Pin It on Pinterest

Share This