目录
目录README.md

fileproxy

A URL proxy, or file download manager, for transient data, especially streamable media resources.

let url: URL = // Local or Remote Asset URL
let asset = AVAsset(url: url)

Motivated through AVAsset, the objective of this package is to provide the URL of a local or remote asset, downloading the file in the background if it isn’t available locally yet.

Background

Working with background downloads, keep this paragraph from Apple’s documentation in mind:

As a result, if your app starts a single background download, gets resumed when the download completes, and then starts a new download, it will greatly increase the delay. Instead, use a small number of background sessions — ideally just one — and use these sessions to start many download tasks at once. This allows the system to perform multiple downloads at once, and resume your app when they have completed.

Testing

Testing and debugging apps with background downloading is tricky. Use logging and launch your app from the Home screen rather than running from Xcode. For debugging specific issues, attach to process from Xcode’s Debug menu.

This package is hardened by production. Additionally, you can run rudimentary tests with the Package Manager.

make test

Install

📦 Add https://github.com/michaelnisi/fileproxy to your package dependencies.

License

MIT

邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号