Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(UIImage *) screenshot:(CGRect )cellRect onCell:(UITableViewCell)cell
- {
- UIGraphicsBeginImageContext(cellRect.size);
- CGContextRef context=UIGraphicsGetCurrentContext();
- [cell.layer renderInContext:context];
- UIImage *image=UIGraphicsGetImageFromCurrentImageContext();
- UIGraphicsEndImageContext();
- return image;
- }
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
- UIImageView *imageV = [[UIImageView alloc]initWithImage:[self screenshot:[tableView rectForRowAtIndexPath:indexPath] onCell:[tableView cellForRowAtIndexPath:indexPath]]];
- imageV.frame = CGRectMake(0, 75, self.tableView.frame.size.width,100);
- UIViewController *viewController = [[UIViewController alloc]init];
- [viewController.view addSubview:imageV];
- UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:viewController];
- [self presentViewController:nav animated:YES completion:^{
- }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement