I want to display a UIProgressView
when the user saves an image to the camera roll.
I need to know how much of the image has been downloaded at a given point to determine what the progress indicator should display. How do I determine this?
I'm doing something like:
- (void)updateSaveProgressBar
{
if ([self.saveProgressView progress] < 1) {
self.saveProgressView.progress = (float)receivedData / (float)totalData;
[NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(updateSaveProgressBar) userInfo:nil repeats:NO];
}
}
self.saveProgressView
is the UIProgressView
. In this example, how do I determine the value of receivedData
?
Thanks.