thiagoperes / IDMPhotoBrowser

Photo Browser / Viewer inspired by Facebook's and Tweetbot's with ARC support, swipe-to-dismiss, image progress and more

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UI on backThread

jokerping opened this issue · comments

  • (void)setProgress:(CGFloat)progress forPhoto:(IDMPhoto*)photo {
    IDMPhoto p = (IDMPhoto)self.photo;

    if ([photo.photoURL.absoluteString isEqualToString:p.photoURL.absoluteString]) {
    //Here in the case of no network will be in the backThread call
    if (_progressView.progress < progress) {
    [_progressView setProgress:progress animated:YES];
    }
    }
    }

Simple solution. file - IDMPhoto.m, line - 143

dispatch_async(dispatch_get_main_queue(), ^{
                    
                    if (self.progressUpdateBlock) {
                        self.progressUpdateBlock(progress);
                    }
                });