UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)];
[imageView addGestureRecognizer:singleTap];
UIView *singleTapView = [singleTap view];
singleTapView.tag = i;
[_picPathStringsArray addObject:url];
- (void)handleSingleTap:(UIGestureRecognizer *)gestureRecognizer {
debugMethod();
NSLog(@"%d",[gestureRecognizer view].tag);
SDPhotoBrowser *browser = [[SDPhotoBrowser alloc] init];
browser.currentImageIndex = [gestureRecognizer view].tag;
browser.sourceImagesContainerView = _scrollView;
browser.imageCount = self.picPathStringsArray.count;
browser.delegate = self;
[browser show];
}
#pragma mark - SDPhotoBrowserDelegate
- (NSURL *)photoBrowser:(SDPhotoBrowser *)browser highQualityImageURLForIndex:(NSInteger)index
{
NSString *imageName = self.picPathStringsArray[index];
NSURL *url = [NSURL URLWithString:imageName];
return url;
}
- (UIImage *)photoBrowser:(SDPhotoBrowser *)browser placeholderImageForIndex:(NSInteger)index
{
UIImageView *imageView = _temp[index];
return imageView.image;
}