I am trying to take a screen shot of view inside a cell of UITableView
but with attached code I can able only to take a screenshot of cell bounds. The problem is that by UIGraphicsBeginImageContextWithOptions(rect.size,YES,0.0f)
. I can only make screenshot of rect size and cannot control origin of rect and
rect = [cell bounds]
. so please suggest me some idea.
{
UITableViewCell* cell = [self.tableView cellForRowAtIndexPath:path];
__block CGRect rect = [cell bounds];
UIGraphicsBeginImageContextWithOptions(rect.size,YES,0.0f);
CGContextRef context = UIGraphicsGetCurrentContext();
[cell.layer renderInContext:context];
UIImage *capturedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
}