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

0 Shares
0
0
0

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.

  • swiftui
  • swift libraries 2020
  • swift libraries list
  • learn swift
  • swift libraries github
0 Shares
You May Also Like