0

i have an collection view. and inside cell contains image view, label, and progress view like this enter image description here

i want to make if cell tapped, it starts download pdf file and the progress view start animating and if the pdf file already downloaded, it display the pdf file instead download again.

the download started but the progressview didn't animate until the download finished it still 0%. and Also get the message says Invalid URL scheme for background downloads: (null). Valid schemes are http or https but the download succeded

here what i've don this far https://gist.github.com/asdwd5/31919950383f290709c5934853c3e9fc

and on my collection view cell https://gist.github.com/asdwd5/c83cc2f2975c1beeb7de487696e99275

I know my code is not clear and disorganized. I'm very new to swift, and just follow any tutorial i found.

Ariel Gemilang
  • 796
  • 2
  • 20
  • 42

1 Answers1

0

After investigation of the code it is possible to conclude that:

When you press required item of the table view you should start animation of the activityIndicator.

cell.activityIndicator.startAnimating()

And there is no need to perform manual hide of the activityIndicator as you do in controller.

cell.activityIndicator.hidden = true

Just smile use this method.

cell.activityIndicator.hidesWhenStopped = true;
Oleg Gordiichuk
  • 15,240
  • 7
  • 60
  • 100
  • i mean, the progress view start animating if download starter. my progress view in collection view cell named progressDownload – Ariel Gemilang Jul 29 '16 at 02:15