0

i have collection view in horizontal position. user can download file, it display progress view, after download complete the progress view is fully filled with blue color but if I scroll the collection view until the file that already downloaded not visible, the progress view missing

here's my code

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
    self.navigationController?.navigationBarHidden = true
}
 override func viewWillAppear(animated: Bool) {
    super.viewWillAppear(true)
    self.navigationController?.navigationBarHidden = true
}
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {

    let cell: magazineCell = self.collectionView.dequeueReusableCellWithReuseIdentifier("Cell", forIndexPath: indexPath) as! magazineCell

    cell.progressDownload.hidden = true //the progress bar
    cell.progressLabel.hidden = true //download percent
    cell.progressDownload.setProgress(0, animated: true)
}

func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
    cell.progressDownload.hidden = false
    cell.progressLabel.hidden = false
}
Ariel Gemilang
  • 796
  • 2
  • 20
  • 42
  • Where are you updating the progress? Are you using `UIProgressView`? I guess what happens is that you loose the reference to your progress view, but it's hard to tell since relevant code is missing. – Andrej Aug 26 '16 at 08:32
  • What you did after completing the download process. – pkc456 Sep 06 '16 at 10:59

1 Answers1

1

When scrolling cells are recreated which hides your progress bar again, somehow you need manage to check if there is already downloading or not ,then set progress bar show/hidden and downloaded progress.

jagdish
  • 166
  • 5