Skip to content
Euro Tech Talk

Euro Tech Talk

Technically conversational

  • Home
  • Gadgets
  • Techs
  • Games
  • Socials
  • Businesses
  • Arts
  • Gifts
  • Travels
  • Contacts
  • Home
  • Latest
  • An easy to use,elegant, native yet powerfull download library made with Swift 3

An easy to use,elegant, native yet powerfull download library made with Swift 3

Madison Genthry September 24, 2021 6 min read
119

The download library is a native iOS app which uses Swift 3 to provide a powerful, easy-to-use interface for downloading files from the internet. It’s been designed with both beginners and experts in mind, so you can use it without any prior knowledge of how to code.

The swift library vs framework is a question that has been asked for a while. It is an easy to use, elegant, native yet powerful download library made with Swift 3.

VeloxDownloader is a Swift 3 download library that is simple to use, beautiful, and powerful. It encapsulates all of the complicated urlsession and download implementations and provides a “one-click” API for downloading files from the internet.

It’s asyncronous, quick, maintainable, extremely configurable, has backgrounding capabilities, and has an in-built GUI for viewing and controlling your files’ download status.

VeloxDownloader Demo

  • The following modes are available:
    • With UI:

      • VeloxDownloader includes an in-built downloading view that displays the download status and presently has the option to halt any download, as shown in the demo above.
      • This API allows you to choose whether or not to enable background downloading for each given file.
    • Without a user interface:

      • This API returns the download progress, time left, and completion status of your download using Swift closures. You may tailor this information to your requirements or even create your own downloading progress GUI using this information.
      • You may also use this API to activate or stop background downloading for any particular file.

‘> 1.6’ pod ‘VeloxDownloader’

  • Importing:

    Open the xcode workspace project once the pod has been successfully installed. Simply use the following file to import the VeloxDownloader into your viewcontroller.

    VeloxDownloader should be imported.

  • (For http download URLs) Apple’s App Transport Security Settings:

    If your download links are in http, double-check that you’ve enabled Allowed Arbitary Load in your settings. For the App Transport Security Settings, use plist.

    screen shot 2016-12-04 at 5 36 39 pm

  • Using VeloxDownloader with the Velox UI for downloads:

    • When utilizing the VeloxDownloading table view, I recommend using a scroll view to display the downloading files. Simply change the VeloxDownloader view to your scroll view, as seen below:

    override the function super.viewDidLoad() let bundle = Bundle(for: VeloxDownloaderList.self) let controller = VeloxDownloaderList let bundle = Bundle(for: VeloxDownloaderList.self) (nibName: “VeloxDownloaderList”, bundle: bundle) self.add ChildViewController(controller) / scrollView is your scroll view’s outlet variable; it’ll be used to show the velox downloading UI. controller.view.frame = scrollView.frame self controller.didMove(toParentViewController: self) view.addSubview(controller.view)

* Then, as shown below, use the downloadFileWithVeloxDownloader command. All you have to do is provide the URL of the file you wish to download, and the VeloxDownloader will do the rest.

Download the IBAction func sender: Any)( sender: Any)( sender: Any)( sender: Any if veloxDownloader = VeloxDownloadManager.sharedInstance; if veloxDownloader = VeloxDownloadManager.sharedInstance; if veloxDownloader

let urlString = “THE FILE’S URL” veloxDownloader.downloadFileWithVeloxDownloader( withURL: url!, name: url!.lastPathComponent, directoryName: nil, friendlyName: nil, backgroundingMode: false) let url = URL(string: urlString)

* To use BackGrounding, just set the backgroundingMode argument to true in the above function.

withURL: url!, name: url!.lastPathComponent, directoryName: nil, friendlyName: nil, backgroundingMode: true) veloxDownloader.downloadFileWithVeloxDownloader( withURL: url!, name: url!.lastPathComponent, directoryName: nil, friendlyName: nil, backgroundingMode: true)

* __VeloxDownloader without the VeloxDownloader UI__: If you want to create your own UI to display and monitor the status of your downloads, you may do so using the closure syntax shown below. Obviously, you won’t have to bother about configuring the VeloxDownloader UI in this mode, as we did in the viewDidLoad() function above.

func download @IBAction @IBAction @IBAction @IBAction @I sender: Any)( sender: Any)( sender: Any)( sender: Any Allow velox to take over. VeloxDownloadManager.sharedInstance = Downloader

(Void) allow remainingTime to expire (CGFloat) -> Void -> Void -> Void -> Void -> Void -> Void -> Void -> Void (Bool) -> Void (Bool) -> Void (Bool) -> Void (Bool

print(“Progress of File: (downloadInstace.filename) is (Float(progress)”) progressClosure = (progress,downloadInstace)

print(“Remaining Time is: (timeRemaning)”) remainingTimeClosure = (timeRemaning)

print(“is Download finished : (status)”) completionClosure = (status)

veloxDownloader.download url!.lastPathComponent, file( withURL: url!, name: url!.lastPathComponent, directory) Friendliness, nil, nil, nil, nil, nil, nil, nil, nil, nil, progressClosure, remainigtClosure, progressClosure, progressClosure, progressClosure, progressClos completionClosure: completion, remainingTimeClosure: remainingTimeClosure closing and setting the scene false) ) ) ) ) ) ) ) ) ) )

let urlString = “THE FILE’S URL” let progress = URL(string: urlString) let url = URL(string: urlString) let url = URL(string: urlString (CGFloat,VeloxDownloadInstance) -> Closure (Void) Allow to Remain Time (CGFloat) -> Void -> Void -> Void -> Void -> Void -> Void -> Void -> Void (Bool) -> Void progress closure remaining = (progress,downloadInstace) in print(“File Progress: (downloadInstace.filename) is (Float(progress)”) Time completion = (timeRemaning) in print(“Remaining Time is: (timeRemaning)”) (status) in print(“is Download Completed : (status)”) Closure = (status) in print(“is Download Completed : (status)”) veloxDownloader.download File( withURL: url!, name: url!.lastPathComponent, directoryName: nil, friendly, friendly, friendly, friendly, friendly, friendly, friendly, friendly, friendly, friendly, friendly, friendly, friendly, friendly, friendly, friendly, friendly, friendly, friendly, nil, nil, nil, nil, nil, progressClosure, remainigtClosure, progressClosure, progressClosure, progressClosure, progressClos remaining timeClosure: Completion and completion of timeClosure and completion of time completion of the task closing and setting the scene false) mode) mode) mode) mode) mode) mode) mode) mode) mode

* To use BackGrounding, just set the backgroundingMode argument to true in the above function. # How can I get the downloaded files back: * All downloaded files are initially downloaded in a temporary directory, then transferred to your application’s normal cache location after completion. Before closing the program, you must manually retrieve the files from your cache directory. To scan your application cache directory, use the following code:

let dir = try FileManager.default.contentsOfDirectory(atPath: cachesDirectoryURLPath.path) for file in dir print(“file is : (file)”) catch let error as NSError print(“error occurred while trying to read cache dir (error.localizedDescription)”) let cachesDirectoryURLPath = URL(fileURLWithPath: NSSearchPathForDirectoriesInDomains(

* On every start, VeloxDownloader deletes the temporary directory to prevent file name conflicts and save system space. In addition, if a file already exists in the cache directory, VeloxDownloader removes it and replaces it. * If a file’s download is interrupted in the midst, VeloxDownloader deletes the file’s traces from the temp and cache directories. # Exercising: Simply clone (or download) this git project and run it on an iOS 10 simulator or device using Xcode 8: https://github.com/nitinsh99/VeloxDownloader.git git clone # Participation: * If you’re feeling fortunate, please STAR the project or mention your project name in this [issue](https://github.com/nitinsh99/VeloxDownloader/issues/15). * If you’ve discovered a problem, please open a new issue, and if you have a feature request, please open a new issue. If you’ve corrected a problem, you’re free to send a pull request. # What’s on the menu: * I’ll be working on adding additional functionality to the VeloxDownloading UI, such as play, pause, and restart. I’ll be working on making the VeloxDownloading UI more aesthetically pleasing. I’ll be working on upgrading the file management classes to provide greater flexibility when it comes to storing downloaded files, ideally using SQLLite and/or CoreDate. * I’ll be working on a file management user interface extension that will make it simpler to browse and handle the list of downloaded files. While backgrounding is enabled, further work on generic alerts will be done. * Thanks to the amazing folks behind [Cocoapods](https://cocoapods.org/about) * VeloxDownloader was inspired by [this](https://github.com/chasseurmic/TWRDownloadManager) downloading library developed in Obj-C. [License](https://github.com/nitinsh99/VeloxDownloader/blob/master/LICENSE)

GitHub

https://github.com/nitinsh99/VeloxDownloader

The awesome ios apps github is a library that allows developers to easily download apps from the iOS App Store. It’s written in Swift 3, and it’s easy to use.

Related Tags

  • swiftui
  • swift libraries 2020
  • swift libraries list
  • learn swift
  • swift libraries github
Total
0
Shares
Share 0
Tweet 0
Pin it 0
Share 0

Continue Reading

Previous: 5 Ways To Improve Your Brand’s Social Media Presence
Next: You’ll be more secure with Windows 11 than with Windows 10

Trending

What is Genshin Impact and how to run it on Mac 1

What is Genshin Impact and how to run it on Mac

April 29, 2022
17 Best Laptops for Insurance Adjusters in 2022 2

17 Best Laptops for Insurance Adjusters in 2022

December 18, 2021
$700 Gaming PC Build 3

$700 Gaming PC Build

November 23, 2021
Battlefield 1 guide 4

Battlefield 1 guide

November 14, 2021
5 Best RGB Fans (2020) 5

5 Best RGB Fans (2020)

November 9, 2021

Related Stories

The Benefits of Using Box Sign box sign 55m signrequestwheatleysiliconangle
9 min read

The Benefits of Using Box Sign

December 17, 2022 121
What is Internet 3.0? big tech capitol internetthompsonstratechery
13 min read

What is Internet 3.0?

December 17, 2022 97
10 Ways to Relieve Arm Pain Fast
3 min read

10 Ways to Relieve Arm Pain Fast

October 28, 2022 148
How to Start a Trucking Company: 5 Actionable Steps
4 min read

How to Start a Trucking Company: 5 Actionable Steps

October 27, 2022 147
Nurse Staffing: A Reason to Leave and a Reason to Stay
3 min read

Nurse Staffing: A Reason to Leave and a Reason to Stay

October 10, 2022 150
iPhone camera vs Android camera
3 min read

iPhone camera vs Android camera

September 27, 2022 277

recent

Everything you need to know: Airpods 1

Everything you need to know: Airpods

August 10, 2022
Charge iPhone Faster 2

Charge iPhone Faster

August 10, 2022
  • Privacy Policy
  • T/C
  • Contact Us
  • About The Crew
© 2022 Eurotechtalk.com
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT