PFImageView methods are quite limited, you can just use loadInBackground , with or without a completion block. In none of these methods a progressBlock is available.
A workaround would be not to assign a PFFile to a PFImageView, but instead load it with a method using a progressBlock parameter.
[myImageFile getDataInBackgroundWithBlock:^(NSData * result, NSError *error)
{
if (result != nil && error == nil)
{
[myImageView setImage:[UIImage imageWithData:result]];
}
else
{
// handle the error
}
}
progressBlock:^(int percentDone)
{
[progressView setProgress:(float)percentDone/100.0f];
}];
This is not as simple as [myPFImageView loadInBackground], but I can't see any other way to get a progress indicator. Note that using a PFImageView is no longer necessary in this case, a simple UIImageView will be sufficient. Maybe one day Parse team will add a progressBlock to their PFFile methods !