Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Drop-in download manager view controller for iOS
Branch: master

Merge pull request #9 from Abizern/patch-1

Update and rename README.txt to
latest commit 0480466ee2
@H2CO3 authored
Failed to load latest commit information.
HCDownloadViewController.h Small improvements; added API for watching download progress
HCDownloadViewController.m Small improvements; added API for watching download progress


HCDownloadViewController *dlvc = [[HCDownloadViewController alloc] init];
dlvc.downloadDirectory = @"/var/mobile/Library/Downloads";
dlvc.delegate = self;
[dlvc downloadURL:[NSURL URLWithString:@""] userInfo:nil];

userInfo is an NSDictionary with arbitrary values, it can even be nil. However, some special keys are respected by the view controller: kHCDownloadKeyTitle corresponds to an NSString which will be used as the title of the download in the table view instead of the file name, and kHCDownloadKeyImage must correspond to an UIImage (if present) that will be displayed in the left side of the table view cell. kHCDownloadKeyFileName shall specify an NSString (if any) that contains a valid filename, to which the downloaded data is to be saved. If not present, the filename suggested by the server will be used.

To inspect the number of downloads currently in progress, use dlvc.numberOfDownloads.

To respond to download events, implement the optional delegate methods:

- (void)downloadController:(HCDownloadViewController *)vc startedDownloadingURL:(NSURL *)url userInfo:(NSDictionary *)userInfo;
- (void)downloadController:(HCDownloadViewController *)vc dowloadedFromURL:(NSURL *)url progress:(float)progress userInfo:(NSDictionary *)userInfo;
- (void)downloadController:(HCDownloadViewController *)vc finishedDownloadingURL:(NSURL *)url toFile:(NSString *)fileName userInfo:(NSDictionary *)userInfo;
- (void)downloadController:(HCDownloadViewController *)vc failedDownloadingURL:(NSURL *)url withError:(NSError *)error userInfo:(NSDictionary *)userInfo;


Something went wrong with that request. Please try again.