forked from xiaoCoderLJ/LJSessionDownloader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LJSessionDownloader.h
48 lines (41 loc) · 1.15 KB
/
LJSessionDownloader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// LJSessionDownloader.h
// Session断点下载
//
// Created by Jay_Apple on 15/7/17.
// Copyright (c) 2015年 Jay_Apple. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface LJSessionDownloader : NSObject
/**
* 工厂方法
*
* @param urlString 需要下载文件的URL
* @param contentPath 文件存储路径
* @param progress 文件下载进度
* @param completion 文件下载完成
*
* @return 实例对象
*/
+ (instancetype)downloadWithURLString:(NSString *)urlString contentPath:(NSString *)contentPath withProgress:(void (^) (CGFloat progress))progress completion:(void (^) ())completion;
/**
* 初始化方法
*
* @param urlString 需要下载文件的URL
* @param contentPath 文件存储路径
* @param progress 文件下载进度
* @param completion 文件下载完成
*
* @return 实例对象
*/
- (instancetype)initWithURLString:(NSString *)urlString contentPath:(NSString *)contentPath withProgress:(void (^) (CGFloat progress))progress completion:(void (^) ())completion;
/**
* 开始下载
*/
- (void)start;
/**
* 暂停下载
*/
- (void)suspend;
@end