Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- RiparazioneTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
- Customer_Document *document = (Customer_Document *)[self.documents objectAtIndex:indexPath.row];
- if (self.photoBrowser) {
- [self.photoBrowser dismissViewControllerAnimated:YES completion:nil];
- self.photoBrowser = nil;
- }
- NSArray *documentImagesLinks = [document imagesLinks];
- if(documentImagesLinks.count > 0) {
- cell.imageTappedBlock = ^{
- NSMutableArray *documentImagesUrls = [[NSMutableArray alloc] init];
- for (Customer_Document_Link *imgLink in documentImagesLinks) {
- NSURL *remoteImageUrl = [imgLink remoteUrl];
- [documentImagesUrls addObject:remoteImageUrl];
- }
- NSArray *photosToShow = [NSArray arrayWithArray:documentImagesUrls];
- documentImagesUrls = nil;
- NSLog(@"photo da visualizzare: %@",photosToShow);
- self.photoBrowser = [[IDMPhotoBrowser alloc] initWithPhotoURLs:photosToShow animatedFromView:self.view];
- [self.photoBrowser setUseWhiteBackgroundColor:true];
- [self.photoBrowser setDisplayToolbar:true];
- [self.photoBrowser setDisplayCounterLabel:true];
- [self.photoBrowser setDisplayArrowButton:true];
- self.photoBrowser.displayActionButton = false;
- self.photoBrowser.delegate = self;
- [self presentViewController:self.photoBrowser animated:YES completion:nil];
- };
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement