I have a progress bar (UIProgressView) that shows the progress off an event and when I stay on the view from when it starts, there is no issue.
However when I switch to an other VC and back again, the progress bar flickers.
I am downloading a file with AFNetworking – in case it makes a difference:-)
Is there a way to prevent this from happening??
This is the code for the cell in which the UIProgressView resides
[_operation setDownloadProgressBlock:^(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead)
{
float progress = ((float)totalBytesRead) / totalBytesExpectedToRead;
//NSLog(@"PROGRESS - %f", progress); //Can be deleted once the progress bar works.
_jwkCell.progressView.progress = progress;
_jwkCell.progressView.progressTintColor = [UIColor redColor];
}];
Fixed it
I just added a check to see if the Float was returning was returning a value other than 0, so it would duplicate the download