thiagoperes / IDMPhotoBrowser

Photo Browser / Viewer inspired by Facebook's and Tweetbot's with ARC support, swipe-to-dismiss, image progress and more
MIT License
2.71k stars 641 forks source link

Can set failure image which will be displayed in case of error #272

Open normalcoder opened 6 years ago

normalcoder commented 6 years ago

Currently the way i found to show error image is to implement method of IDMPhotoBrowserDelegate:

- (void)photoBrowser:(IDMPhotoBrowser *)photoBrowser imageFailed:(NSUInteger)index imageView:(IDMTapDetectingImageView *)imageView {
    imageView.image = [UIImage imageNamed:@"photoError"];
    imageView.hidden = NO;
    imageView.frame = self.view.bounds;
    imageView.contentMode = UIViewContentModeCenter;
}

And this way has side effect: the image flies away on double tap.

Here I offer not so flexible but clear and straghitforward way: new property of IDMPhotoBrowser named failureImage.