README.md 1.64 KB
Newer Older
Roy Marmelstein's avatar
Roy Marmelstein committed
1 2 3 4 5
![Zip - Zip and unzip files in Swift](https://cloud.githubusercontent.com/assets/889949/12374908/252373d0-bcac-11e5-8ece-6933aeae8222.png)

[![Build Status](https://travis-ci.org/marmelroy/Zip.svg?branch=master)](https://travis-ci.org/marmelroy/Zip) [![Version](http://img.shields.io/cocoapods/v/Zip.svg)](http://cocoapods.org/?q=Zip)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)

Roy Marmelstein's avatar
Roy Marmelstein committed
6
# Zip
Roy Marmelstein's avatar
Roy Marmelstein committed
7
A Swift framework for zipping and unzipping files. Simple and quick to use.
Roy Marmelstein's avatar
Roy Marmelstein committed
8 9 10 11 12 13 14 15 16

## Usage

Import Zip at the top of the Swift file.

```swift
import Zip
```

Roy Marmelstein's avatar
Roy Marmelstein committed
17 18
## Quick functions

Roy Marmelstein's avatar
Roy Marmelstein committed
19
Zip includes two quick functions for zipping and unzipping files and they work as you would expect. Both functions take local file path urls. 
Roy Marmelstein's avatar
Roy Marmelstein committed
20 21 22 23 24 25 26 27 28 29 30 31
```swift
do {
    let bb8FilePath = NSBundle.mainBundle().URLForResource("bb8", withExtension: "zip")!
    try Zip().quickUnzipFile(bb8FilePath) // Unzip
    try Zip().quickZipFiles([bb8FilePath], fileName: "archive") // Zip
}
catch ErrorType {
  print("Something went wrong")
}
```


Roy Marmelstein's avatar
Roy Marmelstein committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
### Setting up with Carthage

[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.

You can install Carthage with [Homebrew](http://brew.sh/) using the following command:

```bash
$ brew update
$ brew install carthage
```

To integrate Format into your Xcode project using Carthage, specify it in your `Cartfile`:

```ogdl
github "marmelroy/Zip"
```

### Setting up with [CocoaPods](http://cocoapods.org/?q=Zip)
```ruby
source 'https://github.com/CocoaPods/Specs.git'
pod 'Zip', '~> 0.1'
```