0

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

Manoj Salvi
  • 2,639
  • 1
  • 17
  • 21
  • Please be specific by how you want to display progress bar on which screen .. maybe place download progress bar in main screen – dev_m Dec 31 '15 at 07:35
  • Ya like that only, By click on "download status" button from main view control he again redirected to downloading view, there he find the downloading progress – Krishnakanth Kesana Dec 31 '15 at 07:48

1 Answers1

0

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.

brunobasas
  • 383
  • 2
  • 14
  • Thanks for your response, I am new to ios, I don't know how to create KVO or NSSotification, can you please explain in-detail or example code for this please... – Krishnakanth Kesana Dec 31 '15 at 07:50