MZDownloadManager | download manager uses NSURLSession api to download files | Download Utils library

 by   mzeeshanid Swift Version: 3.3 License: BSD-3-Clause

kandi X-RAY | MZDownloadManager Summary

kandi X-RAY | MZDownloadManager Summary

MZDownloadManager is a Swift library typically used in Utilities, Download Utils, Nodejs applications. MZDownloadManager has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

This download manager uses NSURLSession api to download files. It can download multiple files at a time. It can download large files if app is in background. It can resume downloads if app was quit.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              MZDownloadManager has a medium active ecosystem.
              It has 1100 star(s) with 227 fork(s). There are 45 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 30 open issues and 47 have been closed. On average issues are closed in 112 days. There are 6 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of MZDownloadManager is 3.3

            kandi-Quality Quality

              MZDownloadManager has no bugs reported.

            kandi-Security Security

              MZDownloadManager has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              MZDownloadManager is licensed under the BSD-3-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              MZDownloadManager releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of MZDownloadManager
            Get all kandi verified functions for this library.

            MZDownloadManager Key Features

            No Key Features are available at this moment for MZDownloadManager.

            MZDownloadManager Examples and Code Snippets

            No Code Snippets are available at this moment for MZDownloadManager.

            Community Discussions

            QUESTION

            UI freezes after re-entering Detail-VC during URLSession Background-DownloadTask
            Asked 2018-Mar-20 at 01:33

            Using Swift-4.0.3, iOS-11.2, Xcode-9.2, iPhone-6S (or Simulator-10.0)

            Since about a week I try to figure out what the problem is with the following issue: The UI freezes whenever you re-enter a ViewController that involves a URLSession-Background-DownloadTask. By re-entering, I mean: Going from VC to Detail-VC and back to VC...and then RE-ENTER a second time from VC to the Detail-VC.

            Please find my example project here on github : https://github.com/korners/Test00008

            The sample project uses the MZDownloadManager from mzeeshanid. I tried also other frameworks - same issue. The MZDownloadManager is just a very nice implementation I found.

            Back to the issue: Now - as for the first entry of the Detail-VC: Everything runs smoothly as it should (no issues). Even a closed App will smoothly kick-in to the already running background-downloadTask (no issues - i.e. progressBar and UI-labels update nicely).

            But if the user presses the back button on the Detail-VC (top bar of the NavigationController) - from this moment on, the Detail-VC can only be seen in a frozen default-state ! (no UI updates or progressBar-movements anymore whatsoever).

            I highly appreciate any help on this !

            P.S. By the way, it is not the Segue per se that creates the problems. I also tried instantiating VC from the storyboard - and the same thing: RE-ENTERING freezes the UI :/

            ...

            ANSWER

            Answered 2018-Mar-08 at 06:26

            After some more debugging I figured out that at the re-enter of the Detail-VC, the delegate of the URLSesssion is nil.

            As it turns out - (if set up as background-task) - then the URLSession still existing from a previous download, does not create a new URLSession object but returns the existing one WITH THE OLD DELEGATE OBJECT ATTACHED !!!

            The way the project was set up: By pressing the back-button (or leaving the current Detail-VC) will throw away everything form that ViewController (including its downloadManager-property and his delegate). Therefore, if re-entering the Detail-VC then the URLSession kicking in from previous run will try to send its delegate-methods to the URLSession-delegate that no longer exists !!! (i.e. the one killed when leaving the Detail-VC).

            Interestingly enough, if the App is closed and re-started, then the delegate of the Background-URL-session can be newly set. The holding on to the delegate is only happening as long as the App is running, obviously.

            Thinking loudly, ...one way to go about this, I guess, is for example by keeping a View-object alive (and give it to the background-URLSession as its delegate) and then presenting this View-object whenever there is a need (with addsubView(View) or similar). But in general, it is a bad idea to have unique View-objects throughout the App.

            The best way to go about this, I guess, is to create a singleton-URLSession-object in the first place (that survives throughout and is not affected by any Navigation-controller segue'ing). And therefore also its delegate survives throughout the App.

            My take-home message for now: BE CAREFUL WHO YOU ASSIGN TO THE BACKGROUND-URLSESSION TO BE ITS DELEGATE AND WHAT YOUR APP-LIFECYCLE DOES WITH IT (it won't easily let go of it - not even if the URLSession object (and its delegate together with it) are dead. ;) It will only let go of it if you close the App and re-start)

            Hope, I got that all right ?

            Any suggestions or comments to this subject highly appreciated !

            Source https://stackoverflow.com/questions/49132845

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install MZDownloadManager

            MZDownloadManager is available through CocoaPods. To install it, simply add the following line to your Podfile:.
            In Xcode 11+ Select File > Packages > Add Package Dependency....
            Enter this project's URL: https://github.com/mzeeshanid/MZDownloadManager.git

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/mzeeshanid/MZDownloadManager.git

          • CLI

            gh repo clone mzeeshanid/MZDownloadManager

          • sshUrl

            git@github.com:mzeeshanid/MZDownloadManager.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Download Utils Libraries

            Try Top Libraries by mzeeshanid

            iOS-Speech-To-Text

            by mzeeshanidC

            pythonlearning-userauth

            by mzeeshanidPython

            mzeeshan-me-next

            by mzeeshanidJavaScript