• Stars
    star
    198
  • Rank 190,306 (Top 4 %)
  • Language
    Objective-C
  • License
    BSD 3-Clause "New...
  • Created almost 11 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

iOS download manager, Download a set of files in parallel and sequential order.

##iOS download manager

Build Status

###A Minimalist download manager for iOS

Download a set of files in parallel or sequential order.

###What it provides

  • Easy to integrate and use iOS download manager.
  • Easily download file with the very robust AFNetworking library.
  • Deal only with NSURL, you will never have to keep strong or weak references of the Download managers.
  • Download files in sequential and parallel order.
  • Make sure each file (NSURL) is being downloaded only once.
  • Have multiple listener/delegates on a single download operation.
  • Download operation unique by URL, never download a URL twice.
  • Cache the downloaded file in Memory and on Disk using EGOCache.
  • Easily add and remove listeners to observe the download operations.
  • Singleton classes for fast access and minimum memory overhead.
  • Ensure that the UI Thread is never blocked.
  • Delegate or Block event callbacks.
  • All of the above in two lines of code.

###Motivation

Ever wanted to download a set of images in a parallel or sequential order, like creating a table cell view that resembles Facebook timeline cell that contains multiple images. If you tried to create such thing, then you realised that some images has to be downloaded before the others, namely the first image in the timeline cell must be downloaded before the second image in this same cell (remember we have multi images inside the same cell)

IADownloadManager, will help you download images or any other files in a parallel order. IASequentialDownloadManager, will help you download a set of urls in a sequential order.

###Installation ####Using CocoaPods (Recommended)

  1. Install CocoaPods on your machine Cocoapods
  2. Create a Podfile
  3. Add pod 'IADownloadManager' to your Podfile
  4. in the Terminal run 'pod install'
  5. open App.xcworkspace

####Manual Installation

  1. Copy all the files from IADownloadManager directory to your project.
  2. Copy the files from ThirdParty directory to your project
  3. Add CFNetwork.framework and Security.framework to the project, if you are not sure on how to add frameworks read the following SO answer

###Prerequisite To use the download manager you should have:

  • iOS 5
  • ARC

Third party needed (included within the sources of the project):

###How to use

Every download operation is identified by the NSURL of the file that is getting downloaded, The NSURL will be unique and cached against.

####Download files in parallel order using delegate callback.

Start the download operation

//Start the download operation, if the download operation is already started for this url,
//the urls will never be downloaded twice
[IADownloadManager downloadItemWithURL:url useCache:YES];

Attach Listener

//Attach a listener to the url
[IADownloadManager attachListener:self toURL:url];

Detach Listener

//Detach a listener to the url
[IADownloadManager detachListener:self];

Delegate methods

- (void)downloadManagerDidProgress:(float)progress;
- (void)downloadManagerDidFinish:(BOOL)success response:(id)response;

####Download files in Sequential order using delegate callback.

Start the download operation

//Start the download operation, if the download operation is already started for these urls,
//the urls will never be downloaded twice
[IASequentialDownloadManager downloadItemWithURLs:urls useCache:YES];

Attach Listener

//Attach a listener to the urls
[IASequentialDownloadManager attachListener:self toURLs:urls];

Detach Listener

//Detach a listener to the url
[IASequentialDownloadManager detachListener:self];

Delegate methods

- (void)sequentialManagerProgress:(float)progress atIndex:(int)index;
- (void)sequentialManagerDidFinish:(BOOL)success response:(id)response atIndex:(int)index;

####Block based callback.

There are also a set of blocks to be informed about the event of the download, For blocks based callbacks please refer to the demo.

More Repositories

1

OAStackView

Porting UIStackView to iOS 7+
Objective-C
2,145
star
2

Swiftline

Swiftline is a set of tools to help you create command line applications.
Swift
1,190
star
3

Guaka

The smartest and most beautiful (POSIX compliant) Command line framework for Swift πŸ€–
Swift
1,148
star
4

mockpy

Mockpy is an open source tool to quickly create mock servers.
Python
138
star
5

OALayoutAnchor

Porting NSLayoutAnchor to iOS7 (full port)
Objective-C
83
star
6

Collection-Each

Adding ruby style each iterator to Cocoa/Cocoa touch Swift Array and Range classes, And Int.times{} to Int class
Swift
64
star
7

facebook_messenger

ExFacebookMessenger is a library that helps you create facebook messenger bots easily.
Elixir
59
star
8

OAStatusItemKit

OAStatusItemKit allows you to easily create mac status bar apps with a swifty flavour.
Swift
34
star
9

github-project-landing-page

A Github project landing page theme for Hugo.
HTML
27
star
10

exrequester

Quickly create API clients using module attributes.
Elixir
19
star
11

phoenix_facebook_echo_bot

Elixir sample facebook messenger echo bot using Phoenix framework.
Elixir
19
star
12

RangeSliderView

RangeSliderView provide an easy to use range selection view.
Swift
18
star
13

ipa_utilities

Simple ruby gem to execute common ipa utilities, such as verify integrity, convert certificate formats, re-signs an ipa using a new provision profile and more.
Ruby
17
star
14

zenixir

Elixir Zendesk API Client http://developer.zendesk.com/
Elixir
16
star
15

xserverpy

Manage Xcode server bots from the command line, without the need to open or install Xcode.
Python
16
star
16

dtracer

DTracer is part ruby gem, part iOS pod, that helps the sending and receiving of DTrace commands.
Ruby
14
star
17

IAModelBase

Json (and NSDictionary) to Objective c Model Helper
Objective-C
14
star
18

CodeImager

Generate a beautiful image from a code snippet on Mac OS.
11
star
19

phoenix_facebook_messenger

PhoenixFacebookMessenger is a library that helps you create facebook messenger bots easily with phoenix.
Elixir
10
star
20

IASequenceAnimations

Perform a sequence of animations one after the other using blocks
Objective-C
8
star
21

JavaErlang

Java Erlang Integration using JInterface (OtpErlang)
Java
8
star
22

ex_stub

ExStub provides an easy way to stub a module and record the function calls on it.
Elixir
8
star
23

OADTracer

Objective c library that facilitates the sending of DTrace commands.
Objective-C
8
star
24

Sublime-Text-Midnight

Sublime Text Midnight Theme (ported from Xcode Midnight theme)
7
star
25

IADraggableViewController

Create an apple iOS5 camera like View Controllers container
Objective-C
7
star
26

Suas-iOS

Unidirectional data flow architecture implementation for iOS, macOS, tvOS and watchOS
Swift
7
star
27

specipy

Extract spec descriptions from Kiwi
Python
7
star
28

StringScanner

A string scanner (similar to NSScanner) implementation purely implemented in swift written in swift
Swift
6
star
29

Storyboard_Layout_Translator

Storyboard Layout Translator
Ruby
5
star
30

profiles

A gem that searches local provision profiles and an ipa for a UDID
Ruby
4
star
31

IAAnimationTable

Fun with UITableView
Objective-C
4
star
32

Guaka-Generator

Guaka command line application generator app.
Swift
3
star
33

RandomUser

Objective c iOS library for to generate random users, using https://randomuser.me/
Objective-C
3
star
34

EmojiOntology

Emoji ontology project for UCD
Web Ontology Language
3
star
35

ObjcAndSwift

Objective-C and Swift in the same Dynamic Framework Target
Objective-C
2
star
36

Currying-refresh-token

A swift playground containing samples on how to use swift functional currying
Swift
2
star
37

Suas-Monitor

Cross-platform desktop app for visualizing and debugging apps built with Suas
TypeScript
1
star
38

TestTrunk

Ruby
1
star
39

LeftPad

Swift implementation of the famous npm left-pad (http://left-pad.io/) module
Ruby
1
star
40

Environ

Environ is a library that wrap libc environ to get all the environment variables passed to an application
Swift
1
star
41

homebrew-tap

Homebrew tap for mockpy
Ruby
1
star
42

elixir-algos

Some algorithm solutions in Elixir
Elixir
1
star
43

Swift-type-erasure-playground

Swift Type erasure playground
Swift
1
star