Description
VeloxDownloader is an easy to use,elegant, native yet powerfull download library made with Swift 3. It abstracts all the complex implementations of urlsession and download tasks and provide a "one-click" API which enables you to download the files from the internet.
It's asyncronous, fast, maintainable, highly customizable, has backgrounding capabilities and provides In-built GUI to show and control the download progress of your files.
VeloxDownloader alternatives and similar libraries
Based on the "Network" category.
Alternatively, view VeloxDownloader alternatives based on common mentions on social networks and blogs.
-
Perfect
Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and moreβ¦) -
Reachability.swift
Replacement for Apple's Reachability re-written in Swift with closures -
swifter
Tiny http server engine written in Swift programming language. -
SwiftSoup
SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS) -
Netfox
A lightweight, one line setup, iOS / OSX network debugging library! π¦ -
SwiftHTTP
Thin wrapper around NSURLSession in swift. Simplifies HTTP requests. -
Siesta
The civilized way to write REST API clients for iOS / macOS -
SwiftSocket
The easy way to use sockets on Apple platforms -
APIKit
Type-safe networking abstraction layer that associates request type with response type. -
Swifton
A Ruby on Rails inspired Web Framework for Swift that runs on Linux and OS X -
CocoaMQTT
MQTT 5.0 client library for iOS and macOS written in Swift -
Zewo
Lightweight library for web server applications in Swift on macOS and Linux powered by coroutines. -
ResponseDetective
Sherlock Holmes of the networking layer. :male_detective: -
SwiftWebSocket
A high performance WebSocket client library for swift. -
BlueSocket
Socket framework for Swift using the Swift Package Manager. Works on iOS, macOS, and Linux. -
Connectivity
π Makes Internet connectivity detection more robust by detecting Wi-Fi networks without Internet access. -
WKZombie
WKZombie is a Swift framework for iOS/OSX to navigate within websites and collect data without the need of User Interface or API, also known as Headless browser. It can be used to run automated tests / snapshots and manipulate websites using Javascript. -
Taylor
A lightweight library for writing HTTP web servers with Swift -
Pitaya
π A Swift HTTP / HTTPS networking library just incidentally execute on machines -
Blackfish
A minimal, fast and unopinionated web framework for Swift -
Express
Swift Express is a simple, yet unopinionated web application server written in Swift -
PeerKit
An open-source Swift framework for building event-driven, zero-config Multipeer Connectivity apps -
Heimdallr.swift
Easy to use OAuth 2 library for iOS, written in Swift. -
Socks
π Non-blocking TCP socket layer, with event-driven server and client. -
Embassy
Super lightweight async HTTP server library in pure Swift runs in iOS / MacOS / Linux -
Reach
A simple class to check for internet connection availability in Swift. -
Digger
Digger is a lightweight download framework that requires only one line of code to complete the file download task -
SOAPEngine
This generic SOAP client allows you to access web services using a your iOS app, Mac OS X app and AppleTV app. -
Transporter
A tiny library makes uploading and downloading easier -
SwiftyOAuth
A simple OAuth library for iOS with a built-in set of providers -
Malibu
:surfer: Malibu is a networking library built on promises -
XcodeServerSDK
Access Xcode Server API with native Swift objects. -
BigBrother
Automatically sets the network activity indicator for any performed request.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of VeloxDownloader or a related project?
README
VeloxDownloader
About:
VeloxDownloader is an easy to use,elegant, native yet powerfull download library made with Swift 3. It abstracts all the complex implementations of urlsession and download tasks and provide a "one-click" API which enables you to download the files from the internet.
It's asyncronous, fast, maintainable, highly customizable, has backgrounding capabilities and provides In-built GUI to show and control the download progress of your files.
See it in Action: πΉ
What can it do? πͺπΌ
It has following modes:
- With UI:
- As seen from above demo VeloxDownloader comes with an in built downloaing View that shows the download progress and currently has the ability to stop any download.
- This API let you control if you want to enable background downloading for any specific file download.
- WIthout UI:
- This API uses Swift closures to return the download progress, time remaining and the completion status of your download. You can use this information to cater your needs or even build your own downloaing progress GUI.
- This API also let you enable or disable the background downloading for any specific file download.
- With UI:
Usage: π»
- Installation :
VeloxDownloader can be installed using CocoaPods. Simply put the following line in your PodFile and run pod update
from your terminal.
pod 'VeloxDownloader', '~> 1.6'
- Importing:
Once the pod successfully installs, open the xcode workspace project. In your viewcontroller simply import the VeloxDownloader by using following file.
import VeloxDownloader
- Apple's App Transport Security Settings (For http download links):
If download links are in http, Make sure you have allowed Allowed Arbitary load in your info.plist for the App Transport Security Settings.
- Using VeloxDownloader with Velox downloading UI:
- I recommened using a scroll view to show the downloading files using the VeloxDownloading table view. Just set the VeloxDownloader view to your scroll view like following:
override func viewDidLoad() {
super.viewDidLoad()
let bundle = Bundle(for: VeloxDownloaderList.self)
let controller = VeloxDownloaderList(nibName: "VeloxDownloaderList", bundle: bundle)
self.addChildViewController(controller)
// scrollView is the outlet variable for your scroll view.
// it will be used to display velox downloading UI.
controller.view.frame = scrollView.frame
self.view.addSubview(controller.view)
controller.didMove(toParentViewController: self)
}
- Next : Simply use the
downloadFileWithVeloxDownloader
like following. All you have to pass is the URL of the file you want to download and rest will be taken care of by the VeloxDownloader.
IBAction func downloadClicked(_ sender: Any) {
let veloxDownloader = VeloxDownloadManager.sharedInstance
let urlString = "URL OF YOUR FILE"
let url = URL(string: urlString)
veloxDownloader.downloadFileWithVeloxDownloader(
withURL: url!,
name: url!.lastPathComponent,
directoryName: nil,
friendlyName: nil,
backgroundingMode: false)
}
- With BackGrounding: Simply pass true in the
backgroundingMode
parameter of the above method.
veloxDownloader.downloadFileWithVeloxDownloader(
withURL: url!,
name: url!.lastPathComponent,
directoryName: nil,
friendlyName: nil,
backgroundingMode: true)
- Using VeloxDownloader without Velox downloading UI:
- If you are interested in building your own UI to show and track the progress of your downloads, than you can use the following closure syntax to do just that. Obvisiouly, with this mode you don't have to worry about setting the VeloxDownloader UI as we did above in viewDidLoad() method.
@IBAction func downloadClicked(_ sender: Any) {
let veloxDownloader = VeloxDownloadManager.sharedInstance
let urlString = "URL OF YOUR FILE"
let url = URL(string: urlString)
let progressClosure : (CGFloat,VeloxDownloadInstance) -> (Void)
let remainingTimeClosure : (CGFloat) -> Void
let completionClosure : (Bool) -> Void
progressClosure = {(progress,downloadInstace) in
print("Progress of File : \(downloadInstace.filename) is \(Float(progress))")
}
remainingTimeClosure = {(timeRemaning) in
print("Remaining Time is : \(timeRemaning)")
}
completionClosure = {(status) in
print("is Download completed : \(status)")
}
veloxDownloader.downloadFile(
withURL: url!,
name: url!.lastPathComponent,
directoryName: nil,
friendlyName: nil,
progressClosure: progressClosure,
remainigtTimeClosure: remainingTimeClosure,
completionClosure: completionClosure,
backgroundingMode: false)
}
- With BackGrounding: Simply pass true in the
backgroundingMode
parameter of the above method.
How can I retrieve the downloaded files: π
- All the downloaded files are first downloaded in the temporary directory and post completion they are moved to the default cache directory of your application.
- You have to manually retrieve the files from your cache diretory before the application is closed. You can use following code to scan you application cache directory:
do{
let cachesDirectoryURLPath = URL(fileURLWithPath: NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true)[0])
let dir = try FileManager.default.contentsOfDirectory(atPath: cachesDirectoryURLPath.path)
for file in dir{
print("file is : \(file)")
}
}
catch let error as NSError{
print("error occured while trying to read cache dir \(error.localizedDescription)")
}
- VeloxDownloader clears out the temporary directory on every launch to avoid any file naming conflict and preseve system space.
- Also, if there is already a file present in the cache directory, VeloxDownloader removes the files and replaces the file.
- If download is stopped in the middle for a file than VeloxDownloader removes the file traces from the temp and cache directory.
Demo: ππΌ
Simply clone (or download) this git project and run it using Xcode 8 preferebally on an iOS 10 simulator or device:
git clone https://github.com/nitinsh99/VeloxDownloader.git
Contribution: β€οΈ
- Please STAR the project or mention your project name in this issue if you are feeling lucky.
- Create a seperate issue if you found a bug for if you have a feature request.
- You are welcome to submit a pull reqeust if you fixed a bug.
What's cooking: π²
- I will be working on VeloxDowloading UI to add more features like play, pause, resume.
- I will be working on improving the VeloxDownloading UI to make it more asthetic.
- I will be working on improving the file management classes to give more flexibility on saving the downloaded files preferably by tying it up wiht SQLLite and/or CoreDate
- I will be working on creating a UI extenstion for file management that will make it easier to navigate and control through the list of downloaded files.
- More work on general notifications while the backgrounding is enabled.
Credits: ππΌ
- Thanks to awesome people behind Cocoapods
- I took insipration from this downloading library written for Obj-C to make VeloxDownloader.
License
*Note that all licence references and agreements mentioned in the VeloxDownloader README section above
are relevant to that project's source code only.