LSFastDownloader如何在iOS中通过多个连接并行下载单个文件
LSFast下载器使用该库,您可以通过分块并行下载来更快地下载单个文件。只需通过URL进行初始化,下载完成后将通过文件位置调用完成块。服务器必须支持该文件的基于范围的下载。代码示例:
NSURL *url = [NSURL URLWithString:@\"link to some file\"];
LSFastDownloadTask downloadTask = [[LSFastDownloadTask alloc] initWithURL:url completion:^(NSError error, NSURL *fileLocation) {
if (fileLocation) {
dispatch_async(dispatch_get_main_queue(), ^{
UIImage *image;
});
}
}];