| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
FilomenaOGZ
7年前发布

iOS开源:SRDownloadManager-文件下载管理

   <h2>SRDownloadManager</h2>    <h2>Features</h2>    <ul>     <li>Provide download status callback, download progress callback, download complete callback.</li>     <li>Support multi-task at the same time to download.</li>     <li>Support breakpoint download even exit the App.</li>     <li>Support to delete the specified file by URL and clear all files that have been downloaded.</li>     <li>Support customize the directory where the downloaded files are saved.</li>    </ul>    <ul>     <li>提供下载状态回调, 下载进度回调, 下载完成回调.</li>     <li>支持多任务同时下载.</li>     <li>支持断点下载, 即使退出重启 App.</li>     <li>支持通过 URL 删除指定文件和清除所有已下载的文件.</li>     <li>支持自定义保存下载文件的目录.</li>    </ul>    <h2>Show</h2>    <p style="text-align:center"><img src="https://simg.open-open.com/show/2753a9872b9bf923d84430dd13ef4ea0.png"></p>    <h2>Installation</h2>    <p>Drag the <strong>SRDownloadManager</strong> folder to the project.</p>    <h2>Usage</h2>    <pre>  <code class="language-objectivec">[[SRDownloadManager sharedManager] downloadFile:fileURL state:^(SRDownloadState state) {      // Called when download state changed.  } progress:^(NSInteger receivedSize, NSInteger expectedSize, CGFloat progress) {      // Called when download receive data every time.  } completion:^(BOOL isSuccess, NSString *filePath, NSError *error) {      // Called when download finished with success or error.  }];</code></pre>    <h2>APIs</h2>    <pre>  <code class="language-objectivec">/**   The directory where the downloaded files are saved, default is .../Library/Caches/SRDownloadManager if not setted.   */  @property (nonatomic, copy) NSString *downloadedFilesDirectory;    + (instancetype)sharedManager;    - (void)downloadFile:(NSURL *)URL                 state:(void (^)(SRDownloadState state))state              progress:(void (^)(NSInteger receivedSize, NSInteger expectedSize, CGFloat progress))progress            completion:(void (^)(BOOL isSuccess, NSString *filePath, NSError *error))completion;    - (BOOL)isDownloadFileCompleted:(NSURL *)URL;    - (NSString *)fileFullPath:(NSURL *)URL;    - (CGFloat)fileDownloadedProgress:(NSURL *)URL;    - (void)deleteFile:(NSURL *)URL;  - (void)deleteAllFiles;    - (void)suspendDownloadURL:(NSURL *)URL;  - (void)suspendAllDownloads;    - (void)resumeDownloadURL:(NSURL *)URL;  - (void)resumeAllDownloads;    - (void)cancelDownloadURL:(NSURL *)URL;  - (void)cancelAllDownloads;</code></pre>    <p>If you have any question, submit an issue or contact me.</p>    <p>If this repo helps you, please give it a star.</p>    <p>Have Fun.</p>    <p> </p>    <p> </p>    <p> </p>    
 本文由用户 FilomenaOGZ 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
 转载本站原创文章,请注明出处,并保留原始链接、图片水印。
 本站是一个以用户分享为主的开源技术平台,欢迎各类分享!
 本文地址:https://www.open-open.com/lib/view/open1488939609910.html
开源 iOS开发 移动开发