Skip to content

NSData extension enables gzip/gunzip using zlib

License

Notifications You must be signed in to change notification settings

RayAnd/NSData-GZIP

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NSData+GZIP.swift

Build Status License

NSData+GZIP.swift is an extension of NSData written in Swift 2.0. It enables compress/decompress gzip using zlib.

  • Requirements: OS X 10.9 / iOS 7 or later

Usage

// gzip
let compressedData : NSData = try! data.gzippedData()

// gunzip
let decompressedData : NSData = try! compressedData.gunzippedData()

Installation

  1. Add NSData+GZIP.swift file to your project.
  2. Add zlib/ directory to your project.
  3. In Build Phases, add libz.tbd library to your project. screenshot
  4. In Build Settings > Swift Compiler - Search Paths, Add path to zlib/ to Import Paths (SWIFT_INCLUDE_PATHS). screenshot
  5. Invoke from your Swift/ObjC files.

Lisence

© 2014-2015 1024jp

NSData+GZIP.swift is distributed under the terms of the MIT License. See LISENCE for details.

About

NSData extension enables gzip/gunzip using zlib

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 99.8%
  • C 0.2%