Giter Club home page Giter Club logo

cheapjack's Introduction

Cheapjack

Carthage compatible License

A drop-in framework for adding a background download manager to your iOS app.

CheapjackExample project, as pictured above, demonstrates downloading multiple files and displaying their states in a custom UITableViewCell.

For advanced usage and control over downloads refer to definitions in Cheapjack.swift.

Usage

Cheapjack's pretty simple to use.

class MyDownloadManager {
	class func prepareForDownload() {
		Cheapjack.downloadCompletionHandler = { (download, session, location) -> NSURL? in
			// Return NSURL of location to move the file to once the download completes.
			// Or do it manually and return nil.
			return nil
		}
	}

	func downloadFile() {
		MyDownloadManager.prepareForDownload()

		let url = NSURL("https://support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1425/sample_iPod.m4v.zip") // 2.2 MB
		Cheapjack.downloadWithURL(url, delegate: self)
	}
}

In your app delegate implementation:

func application(application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: () -> Void) {
	MyDownloadManager.prepareForDownload()
	Cheapjack.backgroundSessionCompletionHandler = completionHandler
}

For download states and progress reporting, see Cheapjack.swift public methods and the full featured implementation in the included example project.

Requirements

  • iOS 8.1 SDK+
  • Xcode 7+

Install with Carthage

Add the following to your Cartfile:

github "Gurpartap/Cheapjack"

Run carthage update --platform iOS and follow the adding framework instructions in Carthage's README.

Manual Installation

git clone https://github.com/Gurpartap/Cheapjack.git
cd Cheapjack
  1. Add Cheapjack.xcodeproj to your Xcode project or workspace.
  2. Add Cheapjack.framework to Linked Frameworks and Libraries in your app's target.
  3. Create a New Copy Files Phase with Frameworks as the Destination in the target's Build Phases.
  4. Add Cheapjack.framework to this Copy Files build phase.
  5. Try import Cheapjack in your code. Build should succeeed.

Contact

cheapjack's People

Contributors

gurpartap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cheapjack's Issues

project not building

Hello the project is not able to build with xcode 7 the framework is missing can u help me in this, btw can i add different urls to download

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.