简体   繁体   中英

Download Progress not displaying in all views ios

In my project user can download movies(nearly 1GB).

If clicks on download button he is redirected to Download ViewController, there if clicks start download the download will starts and display progress bar here. Upto here there are no issues for me

Problem - But when he clicks on back button(i had write Dismiss ViewController for back action) downloading process is going on normally, but i am unable to show the Download progress in any other view.

How could i show the download progress from any view. Note:- I didn't use Navigation controller for all tabs, i have used it only some tabs.

Please help me on this...

Thank you

If you allocate the download logic in the VC when you dismiss the VC all the download logic is deallocated too.

You need to create some subscription-based observing downloader singleton.

And in every view you want to track the progress you can subscribe in the viewWillAppear (and unsubscribe in viewWillDisappear ). Then with KVO or NSNotification, for example, you can track the progress.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM