Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. -(UIImage *) screenshot:(CGRect )cellRect onCell:(UITableViewCell)cell
  2. {
  3. UIGraphicsBeginImageContext(cellRect.size);
  4.  
  5. CGContextRef context=UIGraphicsGetCurrentContext();
  6. [cell.layer renderInContext:context];
  7.  
  8. UIImage *image=UIGraphicsGetImageFromCurrentImageContext();
  9. UIGraphicsEndImageContext();
  10.  
  11. return image;
  12. }
  13.  
  14. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  15.  
  16. UIImageView *imageV = [[UIImageView alloc]initWithImage:[self screenshot:[tableView rectForRowAtIndexPath:indexPath] onCell:[tableView cellForRowAtIndexPath:indexPath]]];
  17. imageV.frame = CGRectMake(0, 75, self.tableView.frame.size.width,100);
  18.  
  19. UIViewController *viewController = [[UIViewController alloc]init];
  20. [viewController.view addSubview:imageV];
  21.  
  22. UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:viewController];
  23. [self presentViewController:nav animated:YES completion:^{
  24. }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement