Adding Muvi support for tiercell implementation

Related tags

JSON Tiercel-Muvi
Overview

Version Platform Language SPM Support License

Tiercel 是一个简单易用、功能丰富的纯 Swift 下载框架,支持原生级别后台下载,拥有强大的任务管理功能,可以满足下载类 APP 的大部分需求。

如果你使用的开发语言是 Objective-C ,可以使用 TiercelObjCBridge 进行桥接

Tiercel 3.0

Tiercel 3.0 大幅提高了性能,拥有更完善的错误处理,提供了更多方便的 API。从 Tiercel 2.0 升级到 Tiercel 3.0 是很简单的,强烈推荐所有开发者都进行升级,具体请查看 Tiercel 3.0 迁移指南

特性

  • 支持原生级别的后台下载
  • 支持离线断点续传,App 无论 crash 还是被手动 Kill 都可以恢复下载
  • 拥有精细的任务管理,每个下载任务都可以单独操作和管理
  • 支持创建多个下载模块,每个模块互不影响
  • 每个下载模块拥有单独的管理者,可以对总任务进行操作和管理
  • 支持批量操作
  • 内置了下载速度、剩余时间等常见的下载信息
  • 支持自定义日志
  • 支持下载任务排序
  • 链式语法调用
  • 支持控制下载任务的最大并发数
  • 支持文件校验
  • 线程安全

环境要求

  • iOS 10.0+
  • Xcode 11.0+
  • Swift 5.0+

安装

CocoaPods

Tiercel 支持 CocoaPods 集成,首先需要使用以下命令安装 CocoaPod:

$ gem install cocoapods

Podfile文件中

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'Tiercel'
end

最后运行命令

$ pod install

Swift Package Manager

从 Xcode 11 开始,集成了 Swift Package Manager,使用起来非常方便。Tiercel 也支持通过 Swift Package Manager 集成。

在 Xcode 的菜单栏中选择 File > Swift Packages > Add Pacakage Dependency,然后在搜索栏输入

[email protected]:Danie1s/Tiercel.git,即可完成集成

手动集成

Tiercel 也支持手动集成,只需把本项目文件夹中的Tiercel文件夹拖进需要集成的项目即可

Demo

打开本项目文件夹中 Tiercel.xcodeproj ,可以直接运行 Demo

用法

基本用法

一行代码开启下载

// 创建下载任务并且开启下载,同时返回可选类型的DownloadTask实例,如果url无效,则返回nil
let task = sessionManager.download("http://dldir1.qq.com/qqfile/QQforMac/QQ_V4.2.4.dmg")

// 批量创建下载任务并且开启下载,返回有效url对应的任务数组,urls需要跟fileNames一一对应
let tasks = sessionManager.multiDownload(URLStrings)

可以对任务设置状态回调

let task = sessionManager.download("http://dldir1.qq.com/qqfile/QQforMac/QQ_V4.2.4.dmg")

task?.progress(onMainQueue: true) { (task) in
    let progress = task.progress.fractionCompleted
    print("下载中, 进度:\(progress)")
}.success { (task) in
    print("下载完成")
}.failure { (task) in
    print("下载失败")
}

可以通过 URL 对下载任务进行操作,也可以直接操作下载任务

let URLString = "http://dldir1.qq.com/qqfile/QQforMac/QQ_V4.2.4.dmg"

// 通过 URL 对下载任务进行操作
sessionManager.start(URLString)
sessionManager.suspend(URLString)
sessionManager.cancel(URLString)
sessionManager.remove(URLString, completely: false)

// 直接对下载任务进行操作
sessionManager.start(task)
sessionManager.suspend(task)
sessionManager.cancel(task)
sessionManager.remove(task, completely: false)

后台下载

从 Tiercel 2.0 开始支持原生的后台下载,只要使用 Tiercel 开启了下载任务:

  • 手动 Kill App,任务会暂停,重启 App 后可以恢复进度,继续下载
  • 只要不是手动 Kill App,任务都会一直在下载,例如:
    • App 退回后台
    • App 崩溃或者被系统关闭
    • 重启手机

如果想了解后台下载的细节和注意事项,可以查看:iOS 原生级别后台下载详解

文件校验

Tiercel 提供了文件校验功能,可以根据需要添加,校验结果在回调的task.validation

let task = sessionManager.download("http://dldir1.qq.com/qqfile/QQforMac/QQ_V4.2.4.dmg")
// 回调闭包可以选择是否在主线程上执行
task?.validateFile(code: "9e2a3650530b563da297c9246acaad5c",
                   type: .md5,
                   onMainQueue: true)
                   { (task) in
    if task.validation == .correct {
        // 文件正确
    } else {
        // 文件错误
    }
}

更多

有关 Tiercel 3.0 的详细使用方法和升级迁移,请查看 Wiki

License

Tiercel is available under the MIT license. See the LICENSE file for more info.

You might also like...
Phimp.me - Photo Image Editor and Sharing App. Phimp.me is a Photo App for iOS that aims to replace proprietary photo applications. It offers features such as taking photos, adding filters, editing images and uploading them to social networks. A Generic CoreData Manager to accept any type of objects. Fastest way for adding a Database to your project.
A Generic CoreData Manager to accept any type of objects. Fastest way for adding a Database to your project.

QuickDB FileManager + CoreData ❗️ Save and Retrieve any thing in JUST ONE line of code ❗️ Fast usage dataBase to avoid struggling with dataBase comple

An example of adding a faux notch using AppKit + SwiftUI
An example of adding a faux notch using AppKit + SwiftUI

faux-notch An example of adding a faux notch using AppKit + SwiftUI What is this? It's a bare-bones example that renders a fake MacBook notch in macOS

An iOS framework for easily adding drawings and text to images.
An iOS framework for easily adding drawings and text to images.

jot is an easy way to add touch-controlled drawings and text to images in your iOS app. What's jot for? Annotating Images jot is the easiest way to ad

Swift package adding fraction and percentage types.

swift-rationals Rationals is a package containing Fraction and Percentage types for the Swift programming language. Contents The package currently pro

Swift package adding measurable types.

swift-measures Measures is a package containing measurable types for the Swift programming language. Contents The package currently provides the follo

App for adding and listening audio files
App for adding and listening audio files

SomeSa SomeSa (самса) – приложение, позволяющее загружать и воспроизводить произвольные аудиофайлы. Протестировано на форматах файлов .wav и .mp3, раз

In this mini app covered the concepts like basics of SwiftUI and Navigations and Animations and List with CRUD functions and MVVM and App Launch and App icons adding and also applied persistence using UserDefaults Concept.
In this mini app covered the concepts like basics of SwiftUI and Navigations and Animations and List with CRUD functions and MVVM and App Launch and App icons adding and also applied persistence using UserDefaults Concept.

TodoList In this application used the concepts from the beginner level project of SwiftUI_Evolve_1 The following concepts covered in this mini app Swi

Example of adding marching ants selection to the edges of the image.
Example of adding marching ants selection to the edges of the image.

JMCMarchingAnts Library that lets you add marching ants (animated) selection to the edges of the images. Usage: * Copy the JMCMarchingAnts.swift file

Swift package adding extensions to SwiftUI.

swiftui-extensions SwiftUIX is an umpteenth package containing extensions for Apple's SwiftUI framework. Content The package currently provides the fo

Swift package for adding API Key requirement to vapor backends.

APIKeyMiddleware Swift package for adding API Key requirement to vapor backends. Features ✅ Supports an array of keys ✅ Supports overriding thrown err

SwiftUI module library for adding seasons theme animations to your app
SwiftUI module library for adding seasons theme animations to your app

HolidayThemes SwiftUI module library for adding seasons theme animations to your app. Requirements iOS 13.0+ Xcode 12.0+ Installation Swift Package Ma

This library is for adding animation to iOS tabbar items, which is inherited from UITabBarController.
This library is for adding animation to iOS tabbar items, which is inherited from UITabBarController.

This library is for adding animation to iOS tabbar items, which is inherited from UITabBarController. Installation Just add the Sources folder to your

Import - Xcode extension for adding imports from anywhere in the code ☝️
Import - Xcode extension for adding imports from anywhere in the code ☝️

Import ☝️ Xcode extension for adding imports from anywhere in the code. Now available on App Store Why? Because sometimes you are on 300th line of cod

FinderEx - MacOS Finder Sync Extension to Allow Adding Custom Actions

FinderEx MacOS Finder Sync Extension to Allow Adding Custom Actions Description

Adding ruby style each iterator to Cocoa/Cocoa touch Swift Array and Range classes, And Int.times{} to Int class

Collection-Each Adding ruby style each iterator to Cocoa/Cocoa touch Swift Array, Dictionary and Range classes, and Int.times ###Why? Array/Dictionary

Companion app and XCode extension for adding SwiftUI recipes to your code.
Companion app and XCode extension for adding SwiftUI recipes to your code.

SwiftUI Recipes Companion Free Companion app and XCode extension for adding SwiftUI recipes to your code. Choose from a rich selection of SwiftUI reci

A native iOS UI widget for adding Spokestack to any iOS app.
A native iOS UI widget for adding Spokestack to any iOS app.

A native iOS library for adding Spokestack to any iOS app. Installation Edit Podfile CocoaPods is a dependency manager for Cocoa projects. For usage a

PRGTipView is a drop-in solution for adding onboarding tips to your apps
PRGTipView is a drop-in solution for adding onboarding tips to your apps

PRGTipView PRGTipView is a drop-in solution for adding onboarding tips to your apps. It supports: Title, detail and dismissal button Give focus on a p

Owner
Mohammad ShahibZadeh
Self tought iOS Developer , Founder of Cheetah development group
Mohammad ShahibZadeh
Simple implementation of asset management app UI using swiftUI

MyAssets (자산관리 앱 만들기) swiftUI를 이용하여 자산관리 앱 UI를 간략하게 구현 (swiftUI를 익히기 위함) 초기 화면 1. Tab bar 구현 자산, 추천, 알람, 설정 탭 구현 2. Navigation bar 구현 1) leading에 titl

null 0 Dec 9, 2021
SwiftIB is a pure Swift implementation of the Interactive Brokers TWS API library on Mac OS X

SwiftIB is a pure Swift implementation of the Interactive Brokers TWS API library on Mac OS X, with Core Foundation of crouse. All the API interfaces are implemented. Request Market Data and Request History Data interface are thoroughly tested.

Harry Li 24 Sep 14, 2022
🔥 🔥 🔥Support for ORM operation,Customize the PQL syntax for quick queries,Support dynamic query,Secure thread protection mechanism,Support native operation,Support for XML configuration operations,Support compression, backup, porting MySQL, SQL Server operation,Support transaction operations.

?? ?? ??Support for ORM operation,Customize the PQL syntax for quick queries,Support dynamic query,Secure thread protection mechanism,Support native operation,Support for XML configuration operations,Support compression, backup, porting MySQL, SQL Server operation,Support transaction operations.

null 60 Dec 12, 2022
YiVideoEditor is a library for rotating, cropping, adding layers (watermark) and as well as adding audio (music) to the videos.

YiVideoEditor YiVideoEditor is a library for rotating, cropping, adding layers (watermark) and as well as adding audio (music) to the videos. YiVideoE

coderyi 97 Dec 14, 2022
MZFormSheetPresentationController provides an alternative to the native iOS UIModalPresentationFormSheet, adding support for iPhone and additional opportunities to setup UIPresentationController size and feel form sheet.

MZFormSheetPresentationController MZFormSheetPresentationController provides an alternative to the native iOS UIModalPresentationFormSheet, adding sup

Michał Zaborowski 979 Nov 17, 2022
Makes it easier to support older versions of iOS by fixing things and adding missing methods

PSTModernizer PSTModernizer carefully applies patches to UIKit and related Apple frameworks to fix known radars with the least impact. The current set

PSPDFKit Labs 217 Aug 9, 2022
Kanvas is an open-source iOS library for adding effects, drawings, text, stickers, and making GIFs from existing media or the camera.

Kanvas Kanvas is an open-source iOS library for adding effects, drawings, text, stickers, and making GIFs from existing media or the camera.

Tumblr 267 Nov 24, 2022
:octocat: AdaptiveController is a 'Progressive Reduction' Swift UI module for adding custom states to Native or Custom iOS UI elements. Swift UI component by @Ramotion

ADAPTIVE TAB BAR 'Progressive Reduction' module for adding custom states to Native or Custom UI elements. We specialize in the designing and coding of

Ramotion 2k Nov 9, 2022
RAMAnimatedTabBarController is a Swift UI module library for adding animation to iOS tabbar items and icons. iOS library made by @Ramotion

ANIMATED TAB BAR Swift UI module library for adding animation to iOS tabbar items and icons.

Ramotion 11k Jan 8, 2023
Acčento is an easy-to-use tool for adding Czech diacritics to copied text.

Acčento is an easy-to-use tool for adding Czech diacritics to copied text. The app lives in the menu bar and is activated using a global hot key.

Matty Cross 3 Sep 16, 2021